Skip to content

Tools to easily migrate MySQL schemas to Knex migration files

License

Notifications You must be signed in to change notification settings

leo-diehl/mysql-to-knex

 
 

Repository files navigation

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

About

Tools to easily migrate MySQL schemas to Knex migration files

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 99.6%
  • Dockerfile 0.4%