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

14 statements  

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

1"""add concurrency options 

2 

3Revision ID: 7d6350aea855 

4Revises: f93e1439f022 

5Create Date: 2024-09-11 09:01:06.678866 

6 

7""" 

8 

9import sqlalchemy as sa 1a

10from alembic import op 1a

11 

12import prefect 1a

13from prefect.server.schemas.core import ConcurrencyOptions 1a

14 

15# revision identifiers, used by Alembic. 

16revision = "7d6350aea855" 1a

17down_revision = "f93e1439f022" 1a

18branch_labels = None 1a

19depends_on = None 1a

20 

21 

22def upgrade(): 1a

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

24 batch_op.add_column( 1a

25 sa.Column( 

26 "concurrency_options", 

27 prefect.server.utilities.database.Pydantic(ConcurrencyOptions), 

28 nullable=True, 

29 ) 

30 ) 

31 

32 

33def downgrade(): 1a

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

35 batch_op.drop_column("concurrency_options")