Re: [sqlalchemy] Unique constraint error in PostgrSQL when migrating with Alembic

2023-09-13 Thread Mike Bayer
your revisions table has a composite unique constraint - one constraint with two columns in it. therefore to refer to this constraint via foreign key, you need a single composite foreignkeyconstraint - again, one constraint that links two columns together. you would use ForeignKeyConstraint f

[sqlalchemy] Unique constraint error in PostgrSQL when migrating with Alembic

2023-09-13 Thread Lord Wolfenstein
I have a database that looks like this that I create with Alembic. The relationships are trivial except between Revision and ObjectCount, there it used two foreign keys [image: aaa.png] The code looks like this from datetime import datetime from typing import Opti