H
H
Hanry6542020-04-23 11:32:54
Node.js
Hanry654, 2020-04-23 11:32:54

How to make sure that after adding a new field to models in the table, all data is not deleted, but a new field is added?

If you just synchronize sequelize.sync() - nothing happens
If with "force:true" - deletes and re-creates the table with the desired field

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2020-04-23
@Hanry654

sequelize.sync({ alter: true })

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question