@@ -22,17 +22,25 @@ def upgrade() -> None:
22
22
with op .batch_alter_table ("DOWNLOAD_HISTORY" ) as batch_op :
23
23
batch_op .add_column (sa .Column ('DOWNLOADER' , sa .Text ))
24
24
batch_op .add_column (sa .Column ('DOWNLOAD_ID' , sa .Text ))
25
- op .create_index (op .f ('ix_DOWNLOAD_HISTORY_DOWNLOAD_ID' ), 'DOWNLOAD_HISTORY' , ['DOWNLOAD_ID' ], unique = False )
26
- op .create_index (op .f ('ix_DOWNLOAD_HISTORY_ENCLOSURE' ), 'DOWNLOAD_HISTORY' , ['ENCLOSURE' ], unique = False )
25
+ except Exception as e :
26
+ print (str (e ))
27
+ try :
28
+ with op .batch_alter_table ("SITE_BRUSH_TASK" ) as batch_op :
29
+ batch_op .add_column (sa .Column ('LABEL' , sa .Text ))
30
+ except Exception as e :
31
+ print (str (e ))
32
+ try :
33
+ with op .batch_alter_table ("SITE_BRUSH_TASK" ) as batch_op :
34
+ batch_op .alter_column ('DOWNLOAD_COUNT' , type_ = sa .Integer , existing_type = sa .Text )
35
+ batch_op .alter_column ('REMOVE_COUNT' , type_ = sa .Integer , existing_type = sa .Text )
36
+ batch_op .alter_column ('DOWNLOAD_SIZE' , type_ = sa .Integer , existing_type = sa .Text )
37
+ batch_op .alter_column ('UPLOAD_SIZE' , type_ = sa .Integer , existing_type = sa .Text )
27
38
except Exception as e :
28
39
print (str (e ))
29
40
# ### end Alembic commands ###
30
41
31
42
32
43
def downgrade () -> None :
33
44
# ### commands auto generated by Alembic - please adjust! ###
34
- op .drop_index (op .f ('ix_DOWNLOAD_HISTORY_ENCLOSURE' ), table_name = 'DOWNLOAD_HISTORY' )
35
- op .drop_index (op .f ('ix_DOWNLOAD_HISTORY_DOWNLOAD_ID' ), table_name = 'DOWNLOAD_HISTORY' )
36
- op .drop_column ('DOWNLOAD_HISTORY' , 'DOWNLOAD_ID' )
37
- op .drop_column ('DOWNLOAD_HISTORY' , 'DOWNLOADER' )
45
+ pass
38
46
# ### end Alembic commands ###
0 commit comments