Rajat Sharma
Rajat Sharma

Reputation: 1

How do you trigger table formation in MySQL from nodejs using mysql2 driver just like done by sequelize.sync() method

I have created four table models in my node Models folder. Now I want that these tables should be formed whenever I start server just as done by sequelize.sync() method, but I am not using sequelize only mysql2. Do I need to write some code in my main index js file because as such all the tables are not getting formed

I tried creating all tables in one file but that also didn't work. One more thing I am creating associations between tables does that requires some order of forming tables

Upvotes: 0

Views: 16

Answers (0)

Related Questions