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)')])
评论列表
文章目录