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

16 statements  

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

1"""Add description col to artifact table 

2 

3Revision ID: cf1159bd0d3c 

4Revises: f3df94dca3cc 

5Create Date: 2023-03-15 12:38:50.049225 

6 

7""" 

8 

9import sqlalchemy as sa 1a

10from alembic import op 1a

11 

12# revision identifiers, used by Alembic. 

13revision = "cf1159bd0d3c" 1a

14down_revision = "f3df94dca3cc" 1a

15branch_labels = None 1a

16depends_on = None 1a

17 

18 

19def upgrade(): 1a

20 op.execute("PRAGMA foreign_keys=OFF") 1a

21 

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

23 batch_op.add_column(sa.Column("description", sa.String(), nullable=True)) 1a

24 

25 op.execute("PRAGMA foreign_keys=ON") 1a

26 

27 

28def downgrade(): 1a

29 op.execute("PRAGMA foreign_keys=OFF") 

30 

31 with op.batch_alter_table("artifact", schema=None) as batch_op: 

32 batch_op.drop_column("description") 

33 

34 op.execute("PRAGMA foreign_keys=ON")