Skip to main content

Posts

Showing posts from December 29, 2024

How to edit data base structure in Sequelize (MYSQL)

Sequelize provides a powerful migration system that allows you to carefully manage database  schema changes. Migrations ensure that you can apply specific changes to the  database without risking data loss. Steps to Set Up Migrations: Install Sequelize CLI    npm install --save-dev sequelize-cli Initialize Sequelize CLI: npx sequelize-cli init   These about two commands only will be run once while creating database or when we need to change structure of any table structure once ii is done then for each changes we have to make migration file and have to run it. it may create config.json file in the config/config/json {   "development" : {     "username" : "root" ,     "password" : "Birla@123456" ,     "database" : "mhs" ,     "host" : "82.112.XXX.XX" , // use you server's IP     "dialect" : "mysql" ,     "port" : 3306   },   "test" : {     ...