oradm-to-gql 33.1.0 → 33.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
@@ -52,6 +52,17 @@ module.exports = function (
|
|
52
52
|
views: [],
|
53
53
|
cleanSchema: getCleanSchemaCommand(dialect, schemaName),
|
54
54
|
cleanCommonSchema: getCleanSchemaCommand(dialect, commonSchemaName),
|
55
|
+
extensions: [
|
56
|
+
{
|
57
|
+
cmd: "CREATE EXTENSION IF NOT EXISTS pgcrypto WITH SCHEMA ?? ",
|
58
|
+
isCommon: true,
|
59
|
+
bindings: [commonSchemaName],
|
60
|
+
},
|
61
|
+
{
|
62
|
+
cmd: "CREATE EXTENSION IF NOT EXISTS pgcrypto WITH SCHEMA ?? ",
|
63
|
+
bindings: [schemaName],
|
64
|
+
},
|
65
|
+
],
|
55
66
|
};
|
56
67
|
|
57
68
|
_.each(modelSpec, (modelDef, modelName) => {
|
@@ -45,7 +45,7 @@ async function applySchema(db, schemaSpec, initData, options = {}, appConfig) {
|
|
45
45
|
|
46
46
|
if (!opts.skipTables) {
|
47
47
|
log(`[ORADM-APPLY-SCHEMA] Creating extensions`);
|
48
|
-
await createExtensions(db, opts);
|
48
|
+
await createExtensions(db, schemaSpec, opts);
|
49
49
|
|
50
50
|
log(`[ORADM-APPLY-SCHEMA] Creating tables and functions`);
|
51
51
|
//clean existing schema and create tables and functions
|
@@ -1,20 +1,10 @@
|
|
1
1
|
const Promise = require("bluebird");
|
2
2
|
|
3
|
-
function createExtensions(db, opts = {}) {
|
3
|
+
function createExtensions(db, schemaSpec, opts = {}) {
|
4
4
|
const { logDebug = () => {}, commonSchema, moduleSchema } = opts;
|
5
|
-
|
6
|
-
{
|
7
|
-
cmd: "CREATE EXTENSION IF NOT EXISTS pgcrypto WITH SCHEMA ?? ",
|
8
|
-
isCommon: true,
|
9
|
-
bindings: [commonSchema],
|
10
|
-
},
|
11
|
-
{
|
12
|
-
cmd: "CREATE EXTENSION IF NOT EXISTS pgcrypto WITH SCHEMA ?? ",
|
13
|
-
bindings: [moduleSchema],
|
14
|
-
},
|
15
|
-
];
|
5
|
+
|
16
6
|
db.logSQL(`Creating extensions`);
|
17
|
-
return Promise.each(
|
7
|
+
return Promise.each(schemaSpec.extensions, (cmdDef) => {
|
18
8
|
db.logSQL(cmdDef);
|
19
9
|
if (cmdDef.isCommon) {
|
20
10
|
if (commonSchema) {
|