Skip to content

Commit c9bfe94

Browse files
fix: migration failed on triggers
1 parent 1e2b75f commit c9bfe94

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/shared/migrations/0097_nixpkgsbranch_nixchannel_release_branch.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ class Migration(migrations.Migration):
6060
to="shared.nixpkgsbranch",
6161
),
6262
),
63+
# The table has triggers registered.
64+
# Altering it within the migration will defer them to after the transaction, thus failing the whole thing.
65+
migrations.RunSQL("ALTER TABLE shared_nixchannel DISABLE TRIGGER USER"),
6366
migrations.RunPython(
6467
code=populate_release_branch,
6568
reverse_code=migrations.RunPython.noop,
@@ -94,4 +97,5 @@ class Migration(migrations.Migration):
9497
code=populate_variant,
9598
reverse_code=migrations.RunPython.noop,
9699
),
100+
migrations.RunSQL("ALTER TABLE shared_nixchannel ENABLE TRIGGER USER"),
97101
]

0 commit comments

Comments
 (0)