Alembic autogenerate is unnecessarily detecting removed, added foreign keys #1354
Replies: 1 comment 3 replies
-
your database connection seems to be configued such that qb_schema is the default schema already, so the constructs are being detected as being dropped in your default schema and added in your additional schema: INFO [alembic.autogenerate.compare] Detected removed foreign key (grade_category_id)(id) on table grade alembic keys a table to either therefore solutions are:
|
Beta Was this translation helpful? Give feedback.
-
base.py
alembic/env.py
I have two schemas in a single DBMS and my main schema for the project is "qb_editor". Some models in "qb_editor" has to have foreign keys with tables in "qb_beta" and I am not willing to migrate anything with schema "qb_beta".
The problem is that after I create tables with these configurations(which worked fine), alembic detects added/removed foreign keys even though I have done nothing after the recent alembic upgrade.
I have tried things like
which didnt work, but configuring 'include_schemas' and 'include_name' resulted in detecting all tables again even after the tables are already present.
What can be possible reasons for this problem??
Environments
Beta Was this translation helpful? Give feedback.
All reactions