You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/prefect/server/database/_migrations/versions/postgresql/2025_06_13_160644_3b86c5ea017a_drop_task_run_state_id_foreign_key_.py
+21Lines changed: 21 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,7 @@
6
6
7
7
"""
8
8
9
+
importsqlalchemyassa
9
10
fromalembicimportop
10
11
11
12
# revision identifiers, used by Alembic.
@@ -23,6 +24,26 @@ def upgrade():
23
24
24
25
25
26
defdowngrade():
27
+
# Null out any task_run.state_id values that reference non-existent
28
+
# task_run_state rows. After the FK was dropped (upgrade), the system no
29
+
# longer enforces referential integrity, so orphaned references are
30
+
# expected. Without this cleanup, re-adding the FK would fail with an
Copy file name to clipboardExpand all lines: src/prefect/server/database/_migrations/versions/sqlite/2025_06_13_164506_8bb517bae6f9_drop_task_run_state_id_foreign_key_.py
+21Lines changed: 21 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,7 @@
6
6
7
7
"""
8
8
9
+
importsqlalchemyassa
9
10
fromalembicimportop
10
11
11
12
# revision identifiers, used by Alembic.
@@ -22,6 +23,26 @@ def upgrade():
22
23
23
24
24
25
defdowngrade():
26
+
# Null out any task_run.state_id values that reference non-existent
27
+
# task_run_state rows. After the FK was dropped (upgrade), the system no
28
+
# longer enforces referential integrity, so orphaned references are
29
+
# expected. Without this cleanup, re-adding the FK would fail with an
0 commit comments