Tools to easily migrate MySQL schemas to Knex migration files
- Node JS
- NPM
- Install the required packages with the following command:
npm install
- The parameters can be passed through .env file
- Create the .env file in the root directory with the following definitions:
- MYSQL_SERVER
- MYSQL_USER
- MYSQL_PASS
- MYSQL_DATABASE
Use the .env.sample as example to set the .env file with your configurations and rename it to .env.
It's possible create migration for one table, or for all tables in the defined DB.
- Running script main.js:
# It will create the knex migrations files using the configuration from .env file
npm start
# or
./main.js
The script will create files with migrations definitions for each table in the defined Database