-
Notifications
You must be signed in to change notification settings - Fork 8
/
start.js
27 lines (23 loc) · 834 Bytes
/
start.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
let CreateDB = require('./create_db.js')
let MigrateData = require('./migrate_data.js')
// Starter script for app. Execute the two methods from here (create database schema in PostgreSQL or migrate data from MongoDB)
// -------------------------------------
if (process.argv[2] !== undefined) {
switch (process.argv[2]) {
case 'createdb':
CreateDB(function() {
process.exit()
});
break
case 'migratedata':
MigrateData(function() {
process.exit()
});
break
default:
console.log(process.argv[2] + " not found. Try 'createdb' or 'migratedata' ")
break
}
}
else
console.log("No method stated. Try 'node start.js createdb' or 'node start.js migratedata' ")