cs / migrations /versions /51e54130a912_.py
haoqi7's picture
Upload 1527 files
a8eb386
"""empty message
Revision ID: 51e54130a912
Revises: a900e1b90d4e
Create Date: 2021-03-11 10:43:34.726480
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '51e54130a912'
down_revision = 'a900e1b90d4e'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('_predict_old_20210309')
op.add_column('user', sa.Column('city', sa.String(length=20), nullable=True))
op.add_column('user', sa.Column('country', sa.String(length=20), nullable=True))
op.add_column('user', sa.Column('province', sa.String(length=20), nullable=True))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('user', 'province')
op.drop_column('user', 'country')
op.drop_column('user', 'city')
op.create_table('_predict_old_20210309',
sa.Column('id', sa.INTEGER(), nullable=False),
sa.Column('img_name', sa.VARCHAR(length=64), nullable=True),
sa.Column('img_path', sa.VARCHAR(length=128), nullable=True),
sa.Column('size', sa.VARCHAR(length=20), nullable=True),
sa.Column('predict_time', sa.DATETIME(), nullable=True),
sa.Column('predict_result', sa.VARCHAR(length=64), nullable=True),
sa.Column('user_id', sa.INTEGER(), nullable=True),
sa.Column('predict_value', sa.FLOAT(), nullable=True),
sa.ForeignKeyConstraint(['user_id'], ['user.id'], ),
sa.PrimaryKeyConstraint('id')
)
# ### end Alembic commands ###