Skip to content

Latest commit

 

History

History
52 lines (35 loc) · 1.26 KB

README.md

File metadata and controls

52 lines (35 loc) · 1.26 KB

MySQL to Knex Converter

Build Status Language License: GPL v3

Tools to easily migrate MySQL schemas to Knex migration files

Requirements

  • Node JS
  • NPM

Instructions

  • 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

Creating migration files

# It will create the knex migrations files using the configuration from .env file
npm start
# or
./main.js

Output format

The script will create files with migrations definitions for each table in the defined Database