MassonNN / masson-aiogram-template

This is a scalable and functional template for any bots which will be made with aiogram 3.x
MIT License
115 stars 16 forks source link

The migrations in Alembic are written incorrectly #17

Closed DaniilPK closed 1 year ago

DaniilPK commented 1 year ago

Describe the bug Попытка обратиться к табличке после выполнения всех миграций

To Reproduce Steps to reproduce the behavior:

  1. alembic upgrade head
  2. any sql query into table user or chat

Error logs sqlalchemy.exc.AmbiguousForeignKeysError: Could not determine join condition between parent/child tables on relationship User.user_chat - there are multiple foreign key paths linking the tables. Specify the 'foreign_keys' argument, providing a list of those columns which should be counted as containing a foreign key reference to the parent table.

MassonNN commented 1 year ago

Дело не в миграциях, а в самих релейшенах. Необходимо дополнительно указать foreign_keys в релейшене.