-
Notifications
You must be signed in to change notification settings - Fork 2
/
migrate-mongo-config.js
30 lines (24 loc) · 1.01 KB
/
migrate-mongo-config.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
28
29
30
require('./env');
/**
* Get events DB name from the db-connection url like "mongodb://localhost:27017/hawk_events"
*/
const EVENTS_DB_NAME = process.env.MONGO_EVENTS_DATABASE_URI.split('/').pop();
// In this file you can configure migrate-mongo
const config = {
mongodb: {
url: process.env.MONGO_EVENTS_DATABASE_URI,
databaseName: EVENTS_DB_NAME,
options: {
useNewUrlParser: true, // removes a deprecation warning when connecting
useUnifiedTopology: true, // enables the new unified topology layer
// connectTimeoutMS: 3600000, // increase connection timeout to 1 hour
// socketTimeoutMS: 3600000, // increase socket timeout to 1 hour
},
},
// The migrations dir, can be an relative or absolute path. Only edit this when really necessary.
migrationsDir: 'migrations',
// The mongodb collection where the applied changes are stored. Only edit this when really necessary.
changelogCollectionName: 'migration-schema',
};
// Return the config as a promise
module.exports = config;