2

I want to totally recreate two tables (they will change significantly). The id will change so it's probably difficult to recreate those data. Will they recreate themself from models if I just drop those tables in migration file?

speedingdeer
  • 1,236
  • 2
  • 16
  • 26

1 Answers1

0

Sequelize will only drop and then re-create all the tables if you use sequelize.sync({ force: true }) in your code.

If you want to persist data and map to the new table(s), you should first create the new tables, port the existing data to the new schema and then drop the old table.

AbhinavD
  • 6,892
  • 5
  • 30
  • 40