Every time I call a page, sequelize execute: CREATE TABLE IF NOT EXISTS `user_p...
How can I disable this? the table is created and works fine, I no need sequelize try to create every time.
Automatically creates tables in MySQL database if they don't exist by calling await sequelize.
The init() method requires you to pass a sequelize instance where the Model will be attached to. You also need to provide the modelName option to name the model when you're not extending the Model class. A Sequelize Model can also be initialized using the sequelize.
The Sequelize instance method sync() is used to synchronize your Sequelize model with your database tables. The synchronization happens at the table level.
Sequelize set up Install Sequelize database driver for the database you would like to use by running one of the commands below. Install npm package Sequelize-CLI. Create a project folder. In your project folder path, run the command below to initialize Sequelize in the folder.
Sequelize is doing this, because you either defined a many-to-many association between two models that don't have the option syncOnAssociation
set to false
or you call sequelize.sync
somewhere.
Check this http://sequelizejs.com/docs/latest/usage#block-4-line-56
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With