This is a demo application built with the NodeJs package.
Be sure to check out the [official documentation] (https://github.com/felixge/node-mysql/).
- Clone this repository
npm install -g db-migrate
&&npm install -g db-migrate-mysql
&&npm install
- Configure your database details from database.json file
db-migrate up
this command will run all migration that you have written into the migrations folder in up functiondb-migrate down
this command will rever all migration that you have written into the migrations folder in down functiondb-migrate create my_table
this command will create new migration file after that you need to write up and down commanddb-migrate up --config config/database.json -e prod
for the production mode we need to add the new block in database.json same like dev block and run this command if we have put database.json file in config folder.
db-migrate up -c 5
To limit the number of executed migrations you can execute:db-migrate up 20181207125459-user-bank-details
o execute one migration by its name you can pass the name like thisdb-migrate db:create testDB
This command would create a database named testDB.db-migrate db:drop testDB
This command would drop a database named testDB.