I'm attempting to create using sqlalchemy a multi column unique constraint that will be picked up by Alembic in it's automatic upgrade script generator.
I have create the constraint using:
from sqlalchemy import UniqueConstraint
in my model
UniqueConstraint('col1', 'col2', 'number', name='uix_table_col1_col2_col3')
However, this is not picked up by Alembic in it's automatic script generation.
I can manually create this in the Alembic script by adding in.
op.create_unique_constraint('uq_table_col1_col2_col3', 'table', ['col1', 'col2', 'col3'])
Is there a way to have this be automatically generated by Alembic?
Thank you for your help.