From 312b027ec25b3bb63d6c9f6f66319fee19099798 Mon Sep 17 00:00:00 2001 From: Anatoly Date: Fri, 11 Oct 2019 02:17:14 +0300 Subject: [PATCH 1/4] updated dependencies, updated Nmig's version --- README.md | 2 +- package-lock.json | 20 ++++++++++---------- package.json | 8 ++++---- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index b690f3fc..57e9233b 100644 --- a/README.md +++ b/README.md @@ -89,7 +89,7 @@ from MySQL to PostgreSQL as easy and smooth as possible.

Note: "logs_directory" will be created during script execution.

VERSION

-

Current version is 4.0.2
+

Current version is 5.0.0
(major version . improvements . bug fixes)

KNOWN ISSUES

diff --git a/package-lock.json b/package-lock.json index 7245913b..bba79be6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "nmig", - "version": "4.0.2", + "version": "5.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -14,15 +14,15 @@ } }, "@types/node": { - "version": "12.7.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.7.5.tgz", - "integrity": "sha512-9fq4jZVhPNW8r+UYKnxF1e2HkDWOWKM5bC2/7c9wPV835I0aOrVbS/Hw/pWPk2uKrNXQqg9Z959Kz+IYDd5p3w==", + "version": "12.7.12", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.7.12.tgz", + "integrity": "sha512-KPYGmfD0/b1eXurQ59fXD1GBzhSQfz6/lKBxkaHX9dKTzjXbK68Zt7yGUxUsCS1jeTy/8aL+d9JEr+S54mpkWQ==", "dev": true }, "@types/pg": { - "version": "7.11.1", - "resolved": "https://registry.npmjs.org/@types/pg/-/pg-7.11.1.tgz", - "integrity": "sha512-ayO8XV0xuJV3cEY4wySyD/7MA1HL75UpvJ5JAme00kNWA5pddlGtN4BRG97xgGe2NHgwxN8AkdjTQUEDypM8Uw==", + "version": "7.11.2", + "resolved": "https://registry.npmjs.org/@types/pg/-/pg-7.11.2.tgz", + "integrity": "sha512-4+rj7fnidA77jFURNanuPPc1HrQv+RkhI6s+K18G9zOKbOUUpChA/rbNMqFukNuZ89LoIt/I9dAlxf329TjCNw==", "dev": true, "requires": { "@types/node": "*", @@ -516,9 +516,9 @@ "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" }, "typescript": { - "version": "3.6.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.6.3.tgz", - "integrity": "sha512-N7bceJL1CtRQ2RiG0AQME13ksR7DiuQh/QehubYcghzv20tnh+MQnQIuJddTmsbqYj+dztchykemz0zFzlvdQw==", + "version": "3.6.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.6.4.tgz", + "integrity": "sha512-unoCll1+l+YK4i4F8f22TaNVPRHcD9PA3yCuZ8g5e0qGqlVlJ/8FSateOLLSagn+Yg5+ZwuPkL8LFUc0Jcvksg==", "dev": true }, "util-deprecate": { diff --git a/package.json b/package.json index adb0ae1f..542304df 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nmig", - "version": "4.0.2", + "version": "5.0.0", "description": "The database migration app", "author": "Anatoly Khaytovich", "license": "GPL-3.0", @@ -19,11 +19,11 @@ }, "devDependencies": { "@types/mysql": "^2.15.7", - "@types/node": "^12.7.5", - "@types/pg": "^7.11.1", + "@types/node": "^12.7.12", + "@types/pg": "^7.11.2", "@types/tape": "^4.2.33", "tape": "^4.11.0", - "typescript": "^3.6.3" + "typescript": "^3.6.4" }, "scripts": { "build": "tsc", From 842f7b0d67a377e82431e3cd488b352bcfef71d4 Mon Sep 17 00:00:00 2001 From: Anatoly Date: Fri, 11 Oct 2019 02:38:46 +0300 Subject: [PATCH 2/4] fixed DataLoader.getJson2csvStream function --- src/DataLoader.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DataLoader.ts b/src/DataLoader.ts index b541e171..85cb01d4 100644 --- a/src/DataLoader.ts +++ b/src/DataLoader.ts @@ -195,7 +195,7 @@ async function getJson2csvStream( ): Promise { const tableColumnsResult: DBAccessQueryResult = await dbAccess.query( 'DataLoader::populateTableWorker', - `SHOW COLUMNS FROM ${ originalTableName };`, + `SHOW COLUMNS FROM \`${ originalTableName }\`;`, DBVendors.MYSQL, true, false From 4005051e51340156260e8e6b96fe0ddf34804de6 Mon Sep 17 00:00:00 2001 From: Anatoly Date: Fri, 11 Oct 2019 02:44:35 +0300 Subject: [PATCH 3/4] exit if failed to create a table in target database --- src/TableProcessor.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/TableProcessor.ts b/src/TableProcessor.ts index 4dc09cfe..3f33f31e 100644 --- a/src/TableProcessor.ts +++ b/src/TableProcessor.ts @@ -18,7 +18,7 @@ * * @author Anatoly Khaytovich */ -import { log, generateError } from './FsOps'; +import { log } from './FsOps'; import Conversion from './Conversion'; import DBAccess from './DBAccess'; import DBAccessQueryResult from './DBAccessQueryResult'; @@ -100,7 +100,7 @@ export async function createTable(conversion: Conversion, tableName: string): Pr .join(','); const sqlCreateTable: string = `CREATE TABLE IF NOT EXISTS "${ conversion._schema }"."${ tableName }"(${ columnsDefinition });`; - const createTableResult: DBAccessQueryResult = await dbAccess.query(logTitle, sqlCreateTable, DBVendors.PG, false, false); + const createTableResult: DBAccessQueryResult = await dbAccess.query(logTitle, sqlCreateTable, DBVendors.PG, true, false); if (!createTableResult.error) { log(conversion, `\t--[${ logTitle }] Table "${ conversion._schema }"."${ tableName }" is created...`, conversion._dicTables[tableName].tableLogPath); From db4ab9f8f784bea24935849033a558639d801277 Mon Sep 17 00:00:00 2001 From: Anatoly Date: Fri, 11 Oct 2019 03:41:10 +0300 Subject: [PATCH 4/4] updated README.md file --- README.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 57e9233b..21d20af7 100644 --- a/README.md +++ b/README.md @@ -11,10 +11,8 @@ from MySQL to PostgreSQL as easy and smooth as possible.

indexes, primary and foreign keys exactly as they were before migration.
  • Ability to rename tables and columns during migration.
  • -
  • Ability to recover migration process if disaster took place (without restarting from the beginning).
  • -
  • Ability to migrate big databases - in order to eliminate "process out of memory" issues NMIG will split each table's data into several chunks.
    Each group of chunks will be loaded via separate worker process.
  • - -
  • Speed of data transfer - in order to migrate data fast NMIG uses PostgreSQL COPY protocol.
  • +
  • Ability to recover migration process if disaster took place without restarting from the beginning.
  • +
  • Ability to migrate big databases fast - in order to migrate data NMIG utilizes PostgreSQL COPY protocol.
  • Ease of monitoring - NMIG will provide detailed output about every step, it takes during the execution.
  • Ease of configuration - all the parameters required for migration should be put in one single JSON document.