Coverage for /usr/local/lib/python3.12/site-packages/prefect/server/database/_migrations/versions/sqlite/2023_09_25_121806_8167af8df781_remove_flow_run_id_requirement_from_task_run.py: 73%

15 statements  

« prev     ^ index     » next       coverage.py v7.10.6, created at 2025-12-05 13:38 +0000

1"""Make flow_run_id nullable on task_run and log tables 

2 

3Revision ID: 05ea6f882b1d 

4Revises: 8167af8df781 

5Create Date: 2023-09-25 12:18:06.722322 

6 

7""" 

8 

9from alembic import op 1a

10 

11# revision identifiers, used by Alembic. 

12revision = "05ea6f882b1d" 1a

13down_revision = "8167af8df781" 1a

14branch_labels = None 1a

15depends_on = None 1a

16 

17 

18def upgrade(): 1a

19 with op.batch_alter_table("task_run") as batch_op: 1a

20 batch_op.alter_column("flow_run_id", nullable=True) 1a

21 

22 with op.batch_alter_table("log") as batch_op: 1a

23 batch_op.alter_column("flow_run_id", nullable=True) 1a

24 

25 

26def downgrade(): 1a

27 with op.batch_alter_table("task_run") as batch_op: 

28 batch_op.alter_column("flow_run_id", nullable=False) 

29 

30 with op.batch_alter_table("log") as batch_op: 

31 batch_op.alter_column("flow_run_id", nullable=False)