-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.js
70 lines (63 loc) · 1.91 KB
/
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
const crypto = require('crypto');
const os = require('os');
const path = require('path');
module.exports = {
host: "",
port: "",
dbname: "",
username: "",
password: "",
psql: "psql",
pgdump: "pg_dump",
schemaDumpAdditionalArgs: ["--no-owner", "--no-acl"],
verbose: false,
env: true,
migrationDir: "",
upDirs: [],
downDirs: [],
repetableDirs: [],
repetableBeforeDirs: [],
beforeDirs: [],
afterDirs: [],
upPrefix: "V",
downPrefix: "U",
repetablePrefix: "R",
repetableBeforePrefix: "_R",
beforePrefix: "_B",
afterPrefix: "_A",
separatorPrefix: "__",
finalizePrefix: "TEST",
allFilesAreRepetable: false,
migrationExtensions: [".sql"],
recursiveDirs: false,
dirsOrderedByName: true,
dirsNaturalOrder: true,
dirsOrderReversed: false,
appendTopDirToVersion: false,
appendTopDirToVersionSplitBy: "__",
appendTopDirToVersionPart: 0,
keepMigrationDirHistory: false,
tmpDir: path.join(os.tmpdir(), "___pgmigrations"),
historyTableName: "schema_history",
historyTableSchema: "pgmigrations",
skipPattern: "scrap",
useProceduralScript: false,
warnOnInvalidPrefix: true,
parseScriptTags: true,
parseEnvVars: true,
runOlderVersions: false,
migrationAdditionalArgs: [],
hashFunction: function(data) {
const hash = crypto.createHash('sha1');
hash.update(data);
return hash.digest('hex');
},
sortByPath: true,
sortFunction: (a, b, config) => config.sortByPath ? a.script.localeCompare(b.script, "en") : a.name.localeCompare(b.name, "en"),
versionSortFunction: (a, b, config) => a.version.localeCompare(b.version, "en", {numeric: true}),
failureExitCode: -1,
testFunctionsSchemaSimilarTo: "test",
testFunctionsNameSimilarTo: null,
testFunctionsCommentSimilarTo: null,
testAutomaticallyRollbackFunctionTests: false
}