Skip to content

Commit 8206a95

Browse files
authored
Merge pull request #11618 from Ostap-Zherebetskyi/fix/split_osf_0036_migration
[ENG-10496] Fix migration due to postgres limitation
2 parents 0003dc8 + d440ed7 commit 8206a95

2 files changed

Lines changed: 29 additions & 16 deletions

File tree

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Generated by Django 4.2.17 on 2026-01-27 21:03
2+
3+
from django.db import migrations
4+
5+
from django.core.management import call_command
6+
7+
8+
def run_deduplication_command(apps, schema_editor):
9+
call_command('remove_duplicate_notification_subscriptions_v2')
10+
11+
12+
def reverse(apps, schema_editor):
13+
"""
14+
This is a no-op since we can't restore deleted records.
15+
"""
16+
17+
18+
class Migration(migrations.Migration):
19+
20+
dependencies = [
21+
('contenttypes', '0002_remove_content_type_name'),
22+
('osf', '0035_merge_20251215_1451'),
23+
]
24+
25+
operations = [
26+
migrations.RunPython(run_deduplication_command, reverse),
27+
]

osf/migrations/0036_notification_refactor_post_release.py renamed to osf/migrations/0037_notification_refactor_post_release.py

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,16 @@
1-
# Generated by Django 4.2.17 on 2026-01-27 21:03
1+
# Generated by Django 4.2.17 on 2026-03-03 11:29
22

33
from django.db import migrations, models
44
import osf.utils.fields
55

6-
from django.core.management import call_command
7-
8-
9-
def run_deduplication_command(apps, schema_editor):
10-
call_command('remove_duplicate_notification_subscriptions_v2')
11-
12-
13-
def reverse(apps, schema_editor):
14-
"""
15-
This is a no-op since we can't restore deleted records.
16-
"""
17-
186

197
class Migration(migrations.Migration):
208

219
dependencies = [
22-
('contenttypes', '0002_remove_content_type_name'),
23-
('osf', '0035_merge_20251215_1451'),
10+
('osf', '0036_remove_duplicate_notification_subscriptions_v2'),
2411
]
2512

2613
operations = [
27-
migrations.RunPython(run_deduplication_command, reverse),
2814
migrations.RemoveField(
2915
model_name='notification',
3016
name='seen',

0 commit comments

Comments
 (0)