Converts mysql script to h2 compatible script
Repository has a script which takes mysql data file as input and converts into h2 compatible script. It will be enhanced to fully support conversion of mysql schema to h2 schema as well.
Node with any version preferably above v7
Steps:
npm install
node --harmony h2converter.js <xxxx.sql>
Converted file will be available as h2-formatted/formatted.sql location.
- Reads input file provided in command line
- Returns error if input file is not passed as argument
- Deletes directory 'h2-formatted' if present and creates again
- Converts to h2 compatible format by replacing below characters
` ->
\\0 -> 0
\\1 -> 1
\u0000 -> 0
\u0001 -> 1
For schema conversion
bigint -> numeric
int sizes to just integer
all enums to varchars
remove all default values
remove character sets
- Fully supporting conversion of mysql schema to h2 compatible schema
- Test cases