Coverage for /usr/local/lib/python3.12/site-packages/prefect/server/database/_migrations/versions/sqlite/2024_04_23_094701_75c8f17b8b51_work_status_fields.py: 70%

20 statements  

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

1"""Work status fields 

2 

3Revision ID: 75c8f17b8b51 

4Revises: 824e9edafa60 

5Create Date: 2024-04-23 09:47:01.931872 

6 

7""" 

8 

9import sqlalchemy as sa 1a

10from alembic import op 1a

11 

12# revision identifiers, used by Alembic. 

13revision = "75c8f17b8b51" 1a

14down_revision = "824e9edafa60" 1a

15branch_labels = None 1a

16depends_on = None 1a

17 

18 

19def upgrade(): 1a

20 with op.batch_alter_table("deployment", schema=None) as batch_op: 1a

21 batch_op.add_column( 1a

22 sa.Column( 

23 "status", 

24 sa.Enum("READY", "NOT_READY", name="deployment_status"), 

25 nullable=False, 

26 server_default="NOT_READY", 

27 ) 

28 ) 

29 

30 with op.batch_alter_table("work_pool", schema=None) as batch_op: 1a

31 batch_op.add_column( 1a

32 sa.Column( 

33 "status", 

34 sa.Enum("READY", "NOT_READY", "PAUSED", name="work_pool_status"), 

35 nullable=False, 

36 server_default="NOT_READY", 

37 ) 

38 ) 

39 

40 with op.batch_alter_table("work_queue", schema=None) as batch_op: 1a

41 batch_op.add_column( 1a

42 sa.Column( 

43 "status", 

44 sa.Enum("READY", "NOT_READY", "PAUSED", name="work_queue_status"), 

45 nullable=False, 

46 server_default="NOT_READY", 

47 ) 

48 ) 

49 

50 

51def downgrade(): 1a

52 with op.batch_alter_table("work_queue", schema=None) as batch_op: 

53 batch_op.drop_column("status") 

54 

55 with op.batch_alter_table("work_pool", schema=None) as batch_op: 

56 batch_op.drop_column("status") 

57 

58 with op.batch_alter_table("deployment", schema=None) as batch_op: 

59 batch_op.drop_column("status")