J
J
jtag2021-05-11 15:43:53
MySQL
jtag, 2021-05-11 15:43:53

Sequelize - How to fix error (errno: 150 "Foreign key constraint is incorrectly formed)"?

Sequelize gives an error during migration, I assume that it is not possible to create a relationship, since the parent table has not yet been created. Is it possible to somehow control the order of creating tables in the database in sequelize?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Akina, 2021-05-11
@msa6886

Create migrations in the correct order so that they run in the same order.
Or add foreign key columns later with different migrations (only to add a column).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question