moved configuration files into config directory
This commit is contained in:
parent
810e762bf5
commit
b0400f00a3
|
@ -35,7 +35,7 @@ from MySQL to PostgreSQL as easy and smooth as possible.</p>
|
||||||
<p><b>2.</b> Download Nmig package and put it on the machine running your PostgreSQL (not mandatory, but preferably).<br />
|
<p><b>2.</b> Download Nmig package and put it on the machine running your PostgreSQL (not mandatory, but preferably).<br />
|
||||||
<b>Sample:</b> <code>/path/to/nmig</code></p>
|
<b>Sample:</b> <code>/path/to/nmig</code></p>
|
||||||
|
|
||||||
<p><b>3.</b> Edit configuration file located at <code>/path/to/nmig/config.json</code> with correct details.<br /></p>
|
<p><b>3.</b> Edit configuration file located at <code>/path/to/nmig/config/config.json</code> with correct details.<br /></p>
|
||||||
<b>Notes:</b>
|
<b>Notes:</b>
|
||||||
<ul>
|
<ul>
|
||||||
<li> config.json contains brief description of each configuration parameter</li>
|
<li> config.json contains brief description of each configuration parameter</li>
|
||||||
|
@ -67,7 +67,7 @@ from MySQL to PostgreSQL as easy and smooth as possible.</p>
|
||||||
<b>Sample:</b> <code> CREATE DATABASE nmig_test_db;</code><br />
|
<b>Sample:</b> <code> CREATE DATABASE nmig_test_db;</code><br />
|
||||||
</p>
|
</p>
|
||||||
<p><b>2.</b> Download Nmig package.</p>
|
<p><b>2.</b> Download Nmig package.</p>
|
||||||
<p><b>3.</b> Edit configuration file located at <code>/path/to/nmig/test_config.json</code> with correct details.<br /></p>
|
<p><b>3.</b> Edit configuration file located at <code>/path/to/nmig/config/test_config.json</code> with correct details.<br /></p>
|
||||||
<b>Notes:</b>
|
<b>Notes:</b>
|
||||||
<ul>
|
<ul>
|
||||||
<li> test_config.json contains brief description of each configuration parameter</li>
|
<li> test_config.json contains brief description of each configuration parameter</li>
|
||||||
|
|
0
config.json → config/config.json
Executable file → Normal file
0
config.json → config/config.json
Executable file → Normal file
|
@ -23,7 +23,7 @@
|
||||||
const fs = require('fs');
|
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.
|
* Appends this object to "FromMySQL2PostgreSQL" instance.
|
||||||
*
|
*
|
||||||
* @param {Conversion} self
|
* @param {Conversion} self
|
||||||
|
|
|
@ -44,7 +44,7 @@ const Main = class {
|
||||||
*/
|
*/
|
||||||
readConfig(baseDir, configFileName = 'config.json') {
|
readConfig(baseDir, configFileName = 'config.json') {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
const strPathToConfig = path.join(baseDir, configFileName);
|
const strPathToConfig = path.join(baseDir, 'config', configFileName);
|
||||||
|
|
||||||
fs.readFile(strPathToConfig, (error, data) => {
|
fs.readFile(strPathToConfig, (error, data) => {
|
||||||
if (error) {
|
if (error) {
|
||||||
|
@ -54,7 +54,7 @@ const Main = class {
|
||||||
|
|
||||||
const config = JSON.parse(data);
|
const config = JSON.parse(data);
|
||||||
config.logsDirPath = path.join(baseDir, 'logs_directory');
|
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);
|
resolve(config);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -75,7 +75,7 @@ const Main = class {
|
||||||
return resolve(config);
|
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) => {
|
fs.readFile(strPathToExtraConfig, (error, data) => {
|
||||||
if (error) {
|
if (error) {
|
||||||
|
|
|
@ -27,8 +27,8 @@ const extraConfigProcessor = require('./ExtraConfigProcessor');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts MySQL data types to corresponding PostgreSQL data types.
|
* Converts MySQL data types to corresponding PostgreSQL data types.
|
||||||
* This conversion performs in accordance to mapping rules in './data_types_map.json'.
|
* This conversion performs in accordance to mapping rules in './config/data_types_map.json'.
|
||||||
* './data_types_map.json' can be customized.
|
* './config/data_types_map.json' can be customized.
|
||||||
*
|
*
|
||||||
* @param {Object} objDataTypesMap
|
* @param {Object} objDataTypesMap
|
||||||
* @param {String} mySqlDataType
|
* @param {String} mySqlDataType
|
||||||
|
|
Loading…
Reference in a new issue