Coverage for /usr/local/lib/python3.12/site-packages/prefect/server/database/_migrations/versions/sqlite/2022_06_13_103943_2d900af9cd07_add_anonymous_column_for_block_documents.py: 79%

14 statements  

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

1"""Add anonymous column for block documents 

2 

3Revision ID: 2d900af9cd07 

4Revises: 84892301571a 

5Create Date: 2022-06-13 10:39:43.872563 

6 

7""" 

8 

9import sqlalchemy as sa 1a

10from alembic import op 1a

11 

12# revision identifiers, used by Alembic. 

13revision = "2d900af9cd07" 1a

14down_revision = "84892301571a" 1a

15branch_labels = None 1a

16depends_on = None 1a

17 

18 

19def upgrade(): 1a

20 # ### commands auto generated by Alembic - please adjust! ### 

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

22 batch_op.add_column( 1a

23 sa.Column("is_anonymous", sa.Boolean(), server_default="0", nullable=False) 

24 ) 

25 batch_op.create_index( 1a

26 batch_op.f("ix_block_document__is_anonymous"), 

27 ["is_anonymous"], 

28 unique=False, 

29 ) 

30 

31 # ### end Alembic commands ### 

32 

33 

34def downgrade(): 1a

35 # ### commands auto generated by Alembic - please adjust! ### 

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

37 batch_op.drop_index(batch_op.f("ix_block_document__is_anonymous")) 

38 batch_op.drop_column("is_anonymous") 

39 # ### end Alembic commands ###