Prevent sequelize to drop database in node.js app

后端 未结 1 363
迷失自我
迷失自我 2021-01-18 04:02

First of all, I am using node.js with sequelize ORM and Postgres SQL.

I have 2 simple questions:

  1. Every time I rerun my node application sequelize is

相关标签:
1条回答
  • 2021-01-18 04:17

    As you already figured out, the tables are being dropped because you are doing

    sequelize.sync({ force: true })
    

    The force true part being the culprit

    To your second question - the state of migrations is saved in a table in your db - i believe it's called sequelize_meta

    0 讨论(0)
提交回复
热议问题