-
Notifications
You must be signed in to change notification settings - Fork 68
/
Copy pathknexfile.js
26 lines (24 loc) · 820 Bytes
/
knexfile.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
const diplomat = require('./app/diplomat');
const CustomSqlMigrationSource = require('./app/database/sql-migration-source');
const DB_SCHEMA_REGISTRY =
process.env.DB_SCHEMA_REGISTRY || 'gql-schema-registry-db';
const { client, host, port, username, secret, name } =
diplomat.default.getServiceInstance(DB_SCHEMA_REGISTRY);
module.exports = {
client: client,
connection: {
host: host,
port: port,
database: name,
user: username,
password: secret,
multipleStatements: true,
},
migrations: {
//Required to prevent Knex from complaining that the original js based migrations are not found by CustomSqlMigrationSource
disableMigrationsListValidation: true,
migrationSource: new CustomSqlMigrationSource.default('./migrations'),
//Required for generating new migrations
extension: 'sql',
},
};