I need to run the migrations to create the tables in my database, currently my database is on an azure MySQL server, how do I run the migrations from my local host?
Currently when I run the command it returns this result
npx sequelize-cli db:migrate
Sequelize CLI [Node: 18.18.0, CLI: 6.6.2, ORM: 6.35.2]
Loaded configuration file "config\config.json".
Using environment "development".
No migrations were executed, database schema was already up to date.
Steps for Sequelize migrations targeting an Azure MySQL database
npm install --save-dev sequelize-cli.npx sequelize-cli initcommand initializes a Sequelize project, creating folders likeconfig,models,migrations, andseeders.config/config.jsonfile.npx sequelize-cli model:generatecommand..sequelizercfile is used to specify project configurations, allowing customization of paths for models, migrations, seeders, and the configuration file.With Mysql: Create
.sequelizercFile:Create
config/config.jsFile:Create Sequelize Model and Migration:
Used to generate the model in
db/models/user.jsand a migration file indb/migrations/.Run Migration:
The
npx sequelize-cli db:migratecommand is used to apply migrations and create or update the corresponding database tables.With Azure my SQL: