-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmigrate-mongo-config.js
35 lines (26 loc) · 1.15 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
31
32
33
34
35
// In this file you can configure migrate-mongo
require('dotenv').config();
const mongoDBUri = process.env.MONGODB_URI;
const config = {
mongodb: {
// TODO Change (or review) the url to your MongoDB:
url: mongoDBUri || 'mongodb://localhost:27017',
// TODO Change this to your database name:
databaseName: 'popular-quotes',
options: {
useNewUrlParser: true, // removes a deprecation warning when connecting
useUnifiedTopology: true, // removes a deprecating warning when connecting
},
},
// 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: 'changelog',
// The file extension to create migrations and search for in migration dir
migrationFileExtension: '.js',
// Enable the algorithm to create a checksum of the file contents and use that in the comparison to determin
// if the file should be run. Requires that scripts are coded to be run multiple times.
useFileHash: false,
};
// Return the config as a promise
module.exports = config;