Coverage for /usr/local/lib/python3.12/site-packages/prefect/server/database/_migrations/versions/sqlite/2025_03_19_142603_3457c6ca2360_add_storage_configuration_to_work_pool.py: 85%

13 statements  

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

1"""add storage configuration to work pool 

2 

3Revision ID: 3457c6ca2360 

4Revises: 07ecde74d74d 

5Create Date: 2025-03-19 14:26:03.618303 

6 

7""" 

8 

9import sqlalchemy as sa 1a

10from alembic import op 1a

11 

12import prefect 1a

13 

14# revision identifiers, used by Alembic. 

15revision = "3457c6ca2360" 1a

16down_revision = "07ecde74d74d" 1a

17branch_labels = None 1a

18depends_on = None 1a

19 

20 

21def upgrade(): 1a

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

23 batch_op.add_column( 1a

24 sa.Column( 

25 "storage_configuration", 

26 prefect.server.utilities.database.Pydantic( 

27 prefect.server.schemas.core.WorkPoolStorageConfiguration 

28 ), 

29 server_default="{}", 

30 nullable=False, 

31 ) 

32 ) 

33 

34 

35def downgrade(): 1a

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

37 batch_op.drop_column("storage_configuration")