1 """Add description col to artifact table
2
3 Revision ID: cf1159bd0d3c
4 Revises: f3df94dca3cc
5 Create Date: 2023-03-15 12:38:50.049225
6
7 """
8
9 import sqlalchemy as sa 1 ctx 1a
10 from alembic import op 1 ctx 1a
11
12 # revision identifiers, used by Alembic.
13 revision = "cf1159bd0d3c" 1 ctx 1a
14 down_revision = "f3df94dca3cc" 1 ctx 1a
15 branch_labels = None 1 ctx 1a
16 depends_on = None 1 ctx 1a
17
18
19 def upgrade ( ) : 1 ctx 1a
20 op . execute ( "PRAGMA foreign_keys=OFF" ) 1 ctx 1a
21
22 with op . batch_alter_table ( "artifact" , schema = None ) as batch_op : 1 ctx 1a
23 batch_op . add_column ( sa . Column ( "description" , sa . String ( ) , nullable = True ) ) 1 ctx 1a
24
25 op . execute ( "PRAGMA foreign_keys=ON" ) 1 ctx 1a
26
27
28 def downgrade ( ) : 1 ctx 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" )