def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('location',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('location', sa.String(), nullable=False),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('location')
)
op.add_column('event', sa.Column('location_id', sa.Integer(), nullable=True))
op.drop_constraint('event_title_key', 'event', type_='unique')
op.create_foreign_key(None, 'event', 'location', ['location_id'], ['id'])
op.drop_column('event', 'title')
# ### end Alembic commands ###
5f6302b63190_remove_event_title_and_create_location_.py 文件源码
python
阅读 23
收藏 0
点赞 0
评论 0
评论列表
文章目录