sqlalchemy / alembic

A database migrations tool for SQLAlchemy.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sql Server default constraints have generated names

marshall62 opened this issue · comments

The use of server_default results in a generated constraint in Sql Server.
op.add_column("OrderTable", sa.Column("item_counter", sa.Integer(), nullable=False, server_default="0"))

A constraint like df_OrderTable_item_cou__5A843B7E3. is generated when alembic upgrade is run.

At present, there is no way to gain control over the name of the constraint. This means that the downgrade function fails
because there is no way to add a command to delete the constraint.