sqlalchemy-bot / test_alembic_1

0 stars 0 forks source link

mssql clustered index non primary #485

Closed sqlalchemy-bot closed 6 years ago

sqlalchemy-bot commented 6 years ago

Migrated issue, originally created by zimablue (zimablue)

Is there a solution for autogenerating in a single pass MSSQL tables with a primary key which isn't the clustered index, and a clustered index on a different column.

Just defining a second clustered index column creates an exception because MSSQL is automatically setting the primary key to be the clustered index, setting index=False on that column definition doesn't help.

If you manually run two revisions, one without the pks and then add the pks in later everything is fine but I can't see a way to configure the autogeneration to push constraint definitions to later statements, which would work, or force MSSQL not to create the clustered index on the PK.

sqlalchemy-bot commented 6 years ago

Michael Bayer (zzzeek) wrote:

if you can show me the DDL you want to emit I can help get you there.

this is a usage question so far so let's pick it up on https://groups.google.com/forum/#!forum/sqlalchemy-alembic. thanks!

sqlalchemy-bot commented 6 years ago

Michael Bayer (zzzeek) wrote:

usage question