Im trying to apply migrations using alembic to Azure Synapse SQL DW. Im facing following issue while performing alembic upgrade head
:
sqlalchemy.exc.ProgrammingError: (pyodbc.ProgrammingError) ('42000', '[42000] [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Enforced unique constraints are not supported. To create an unenforced unique constraint you must include the NOT ENFORCED syntax as part of your statement. (104467) (SQLExecDirectW)')
[SQL:
CREATE TABLE alembic_version (
version_num VARCHAR(32) NOT NULL,
CONSTRAINT alembic_version_pkc PRIMARY KEY (version_num)
)
]
(Background on this error at: https://sqlalche.me/e/14/f405)
my version file is :
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '6c51cb206ea6'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
op.create_table(
'dqrule',
sa.Column('id', sa.Integer, primary_key=True),
sa.Column('description', sa.String, nullable=False),
sa.Column('source_type', sa.String, nullable=False),
sa.Column('source_schema', sa.String, nullable=False),
sa.Column('source_entity', sa.String, nullable=False)
)
def downgrade():
op.drop_table('dqrule')