Skip to content
This repository was archived by the owner on Dec 1, 2023. It is now read-only.

Commit 4990e20

Browse files
committed
fix 合并脚本
1 parent 2672193 commit 4990e20

File tree

3 files changed

+14
-78
lines changed

3 files changed

+14
-78
lines changed

db_scripts/versions/1ee040543ac1_1_1_1.py

+14-6
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,25 @@ def upgrade() -> None:
2222
with op.batch_alter_table("DOWNLOAD_HISTORY") as batch_op:
2323
batch_op.add_column(sa.Column('DOWNLOADER', sa.Text))
2424
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)
2738
except Exception as e:
2839
print(str(e))
2940
# ### end Alembic commands ###
3041

3142

3243
def downgrade() -> None:
3344
# ### 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
3846
# ### end Alembic commands ###

db_scripts/versions/4cccf1481cf7_1_1_2.py

-32
This file was deleted.

db_scripts/versions/8f0ff297e62d_1_1_3.py

-40
This file was deleted.

0 commit comments

Comments
 (0)