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

11 statements  

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

1"""Add tags column to automation table 

2 

3Revision ID: bb2345678901 

4Revises: 3c841a1800a1 

5Create Date: 2025-06-12 14:45:00.000000 

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 = "bb2345678901" 1a

16down_revision = "3c841a1800a1" 1a

17branch_labels = None 1a

18depends_on = None 1a

19 

20 

21def upgrade(): 1a

22 op.add_column( 1a

23 "automation", 

24 sa.Column( 

25 "tags", 

26 prefect.server.utilities.database.JSON(astext_type=sa.Text()), 

27 server_default="[]", 

28 nullable=False, 

29 ), 

30 ) 

31 

32 

33def downgrade(): 1a

34 op.drop_column("automation", "tags")