Skip to content

Tools to easily migrate MySQL schemas to Knex migration files

License

Notifications You must be signed in to change notification settings

leads2b/mysql-to-knex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

5376004 · Jun 18, 2020

History

24 Commits
Jul 27, 2019
Sep 4, 2019
Jul 27, 2019
Jul 31, 2019
Jul 27, 2019
Jul 27, 2019
May 22, 2019
Jul 27, 2019
Jul 27, 2019
Aug 18, 2019
Jun 18, 2020
Jun 18, 2020
Dec 18, 2019

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