1 """Add block schema indexes
2
3 Revision ID: 9e2a1c08c6f1
4 Revises: 2d900af9cd07
5 Create Date: 2022-06-17 20:45:30.744575
6
7 """
8
9 from alembic import op 1 ctx 1a
10
11 # revision identifiers, used by Alembic.
12 revision = "9e2a1c08c6f1" 1 ctx 1a
13 down_revision = "2d900af9cd07" 1 ctx 1a
14 branch_labels = None 1 ctx 1a
15 depends_on = None 1 ctx 1a
16
17
18 def upgrade ( ) : 1 ctx 1a
19 # ### commands auto generated by Alembic - please adjust! ###
20 op . create_index ( 1 ctx 1a
21 op . f ( "ix_block_schema__block_type_id" ) ,
22 "block_schema" ,
23 [ "block_type_id" ] ,
24 unique = False ,
25 )
26 op . create_index ( 1 ctx 1a
27 op . f ( "ix_block_schema__created" ) , "block_schema" , [ "created" ] , unique = False
28 )
29
30 # there is already a unique index on this column, so this btree index is redundant
31 op . drop_index ( op . f ( "ix_block_schema__checksum" ) , table_name = "block_schema" ) 1 ctx 1a
32
33 # ### end Alembic commands ###
34
35
36 def downgrade ( ) : 1 ctx 1a
37 # ### commands auto generated by Alembic - please adjust! ###
38 op . drop_index ( op . f ( "ix_block_schema__created" ) , table_name = "block_schema" )
39 op . drop_index ( op . f ( "ix_block_schema__block_type_id" ) , table_name = "block_schema" )
40 op . create_index (
41 op . f ( "ix_block_schema__checksum" ) , "block_schema" , [ "checksum" ] , unique = False
42 )
43 # ### end Alembic commands ###