From b0400f00a35c4ed6d07b3eeccae55338fe7d63e7 Mon Sep 17 00:00:00 2001
From: Anatoly
Date: Wed, 14 Feb 2018 09:56:04 +0200
Subject: [PATCH] moved configuration files into config directory
---
README.md | 4 ++--
config.json => config/config.json | 0
data_types_map.json => config/data_types_map.json | 0
extra_config.json => config/extra_config.json | 0
test_config.json => config/test_config.json | 0
src/DataTypesMapReader.js | 2 +-
src/Main.js | 6 +++---
src/TableProcessor.js | 4 ++--
8 files changed, 8 insertions(+), 8 deletions(-)
rename config.json => config/config.json (100%)
mode change 100755 => 100644
rename data_types_map.json => config/data_types_map.json (100%)
rename extra_config.json => config/extra_config.json (100%)
rename test_config.json => config/test_config.json (100%)
diff --git a/README.md b/README.md
index c786130..b43ceaf 100644
--- a/README.md
+++ b/README.md
@@ -35,7 +35,7 @@ from MySQL to PostgreSQL as easy and smooth as possible.
2. Download Nmig package and put it on the machine running your PostgreSQL (not mandatory, but preferably).
Sample: /path/to/nmig
-3. Edit configuration file located at /path/to/nmig/config.json
with correct details.
+3. Edit configuration file located at /path/to/nmig/config/config.json
with correct details.
Notes:
- config.json contains brief description of each configuration parameter
@@ -67,7 +67,7 @@ from MySQL to PostgreSQL as easy and smooth as possible.
Sample: CREATE DATABASE nmig_test_db;
2. Download Nmig package.
-3. Edit configuration file located at /path/to/nmig/test_config.json
with correct details.
+3. Edit configuration file located at /path/to/nmig/config/test_config.json
with correct details.
Notes:
- test_config.json contains brief description of each configuration parameter
diff --git a/config.json b/config/config.json
old mode 100755
new mode 100644
similarity index 100%
rename from config.json
rename to config/config.json
diff --git a/data_types_map.json b/config/data_types_map.json
similarity index 100%
rename from data_types_map.json
rename to config/data_types_map.json
diff --git a/extra_config.json b/config/extra_config.json
similarity index 100%
rename from extra_config.json
rename to config/extra_config.json
diff --git a/test_config.json b/config/test_config.json
similarity index 100%
rename from test_config.json
rename to config/test_config.json
diff --git a/src/DataTypesMapReader.js b/src/DataTypesMapReader.js
index 6b8f269..d7521a1 100644
--- a/src/DataTypesMapReader.js
+++ b/src/DataTypesMapReader.js
@@ -23,7 +23,7 @@
const fs = require('fs');
/**
- * Reads "./data_types_map.json" and converts its json content to js object.
+ * Reads "./config/data_types_map.json" and converts its json content to js object.
* Appends this object to "FromMySQL2PostgreSQL" instance.
*
* @param {Conversion} self
diff --git a/src/Main.js b/src/Main.js
index 1c57627..a112ba1 100644
--- a/src/Main.js
+++ b/src/Main.js
@@ -44,7 +44,7 @@ const Main = class {
*/
readConfig(baseDir, configFileName = 'config.json') {
return new Promise(resolve => {
- const strPathToConfig = path.join(baseDir, configFileName);
+ const strPathToConfig = path.join(baseDir, 'config', configFileName);
fs.readFile(strPathToConfig, (error, data) => {
if (error) {
@@ -54,7 +54,7 @@ const Main = class {
const config = JSON.parse(data);
config.logsDirPath = path.join(baseDir, 'logs_directory');
- config.dataTypesMapAddr = path.join(baseDir, 'data_types_map.json');
+ config.dataTypesMapAddr = path.join(baseDir, 'config', 'data_types_map.json');
resolve(config);
});
});
@@ -75,7 +75,7 @@ const Main = class {
return resolve(config);
}
- const strPathToExtraConfig = path.join(baseDir, 'extra_config.json');
+ const strPathToExtraConfig = path.join(baseDir, 'config', 'extra_config.json');
fs.readFile(strPathToExtraConfig, (error, data) => {
if (error) {
diff --git a/src/TableProcessor.js b/src/TableProcessor.js
index 76118e9..ed915b4 100644
--- a/src/TableProcessor.js
+++ b/src/TableProcessor.js
@@ -27,8 +27,8 @@ const extraConfigProcessor = require('./ExtraConfigProcessor');
/**
* Converts MySQL data types to corresponding PostgreSQL data types.
- * This conversion performs in accordance to mapping rules in './data_types_map.json'.
- * './data_types_map.json' can be customized.
+ * This conversion performs in accordance to mapping rules in './config/data_types_map.json'.
+ * './config/data_types_map.json' can be customized.
*
* @param {Object} objDataTypesMap
* @param {String} mySqlDataType