-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.flyway.js
51 lines (50 loc) · 1.66 KB
/
.flyway.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
const { ConnectionString } = require('connection-string');
const cs = new ConnectionString(process.env.DATABASE_URL);
const {
user: USERNAME,
password: PASSWORD,
HOST = cs.host,
DATABASE = cs.path && cs.path[0],
SCHEMA = cs.params && cs.params.schema,
SCHEMAS = cs.params && cs.params.schemas,
} = cs;
module.exports = {
flywayArgs: {
url: `jdbc:postgresql://${HOST}/${DATABASE}`,
schemas: SCHEMAS || SCHEMA,
defaultSchema: SCHEMA,
locations: `filesystem:${
process.env.DATABASE_MIGRATIONS_LOCATIONS || 'migrations'
}`,
user: USERNAME,
password: PASSWORD,
table: '__migrations',
sqlMigrationSuffixes: '.sql',
baselineOnMigrate: true,
},
// Use to configure environment variables used by flyway
env: {
JAVA_ARGS: '-Djava.util.logging.config.file=./conf/logging.properties',
},
version: '10.21.0', // optional, empty or missing will download the latest
mavinPlugins: [
{
// optional, use to add any plugins (ie. logging)
groupId: 'org.slf4j',
artifactId: 'slf4j-api',
version: '1.7.36',
// This can be a specifc url to download that may be different then the auto generated url.
downloadUrl:
'https://repo1.maven.org/maven2/org/slf4j/slf4j-api/1.7.36/slf4j-api-1.7.36.jar',
},
{
groupId: 'org.slf4j',
artifactId: 'slf4j-jdk14',
version: '1.7.36',
},
],
downloads: {
storageDirectory: `${__dirname}/tmp`, // optional, the specific directory to store the flyway downloaded files. The directory must be writable by the node app process' user.
expirationTimeInMs: -1, // optional, -1 will never check for updates, defaults to 1 day.
},
};