-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.sequelizerc
28 lines (25 loc) · 963 Bytes
/
.sequelizerc
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
28
require('dotenv').config();
const path = require("path");
const isProduction = process.env.NODE_ENV === 'production';
const pathDevShortcut = 'src/db/sequelize'
const pathConfig = {
dev: {
'config': path.resolve(`${pathDevShortcut}/config`, 'config.js'),
'models-path': path.resolve(pathDevShortcut, 'models'),
'seeders-path': path.resolve(pathDevShortcut, 'seeders'),
'migrations-path': path.resolve(pathDevShortcut, 'migrations')
},
prod: {
'config': path.resolve('config', 'config.js'),
'models-path': path.resolve('models'),
'seeders-path': path.resolve('seeders'),
'migrations-path': path.resolve('migrations')
}
}
const currentPathConfig = isProduction ? pathConfig.prod : pathConfig.dev;
module.exports = {
'config': currentPathConfig['config'],
'models-path': currentPathConfig['models-path'],
'seeders-path': currentPathConfig['seeders-path'],
'migrations-path': currentPathConfig['migrations-path']
};