Skip to content

Alembic Primary Key issue with mssql ( Azure Synapse SQL DW ) #939

Discussion options

You must be logged in to vote

I was able to suppress the creation of the primary key on the alembic_version table by doing the following:

Edit env.py and add the version_table_pk=False option to the context.configure() call in the run_migrations_online() function. That is, this …

    with connectable.connect() as connection:
        context.configure(
            connection=connection, target_metadata=target_metadata
        )

… becomes this

    with connectable.connect() as connection:
        context.configure(
            connection=connection, target_metadata=target_metadata,
            version_table_pk=False
        )

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@CaselIT
Comment options

Answer selected by CaselIT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question usage and API questions
3 participants
Converted from issue

This discussion was converted from issue #938 on September 29, 2021 15:18.