a7c617755721_.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:tasking-manager 作者: hotosm 项目源码 文件源码
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('licenses',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(), nullable=True),
    sa.Column('description', sa.String(), nullable=True),
    sa.Column('plain_text', sa.String(), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('name')
    )
    op.create_table('users_licenses',
    sa.Column('user', sa.BigInteger(), nullable=True),
    sa.Column('license', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['license'], ['licenses.id'], ),
    sa.ForeignKeyConstraint(['user'], ['users.id'], )
    )
    op.drop_index('idx_areas_of_interest_centroid', table_name='areas_of_interest')
    op.drop_index('idx_areas_of_interest_geometry', table_name='areas_of_interest')
    op.add_column('projects', sa.Column('license_id', sa.Integer(), nullable=True))
    op.create_foreign_key('fk_licenses', 'projects', 'licenses', ['license_id'], ['id'])
    op.drop_index('idx_tasks_geometry', table_name='tasks')
    # ### end Alembic commands ###

    # Custom index, not created with reflection
    op.create_index('idx_username_lower', 'users', [text('lower(username)')])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号