You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 3, 2022. It is now read-only.
Hey @jonlambert ,
I'm using sequelize for about 2 years, and in the past I had loaded models on migrations until I had experienced some problems with that. Migrations are intended to automate the job for applying database changes during development, meaning that your models will be always updated. As so, IMHO, you should not use models during migrations and use queries instead.
Absolutely, agreed. However, what I'm looking to do is add a relationship in the same way as the models do - with foreign keys etc. There is no documentation on how to re-create the database structure generated by the Models API in a migration.
When defining a migration, how can I specify a relationship to another Model (thus creating the valid foreign keys)?
There's plenty of documentation for adding this via .sync(), but none that I can find for adding via migrations.
The text was updated successfully, but these errors were encountered: