From 8f4c95b749761688eeb864f236f04d27c0899112 Mon Sep 17 00:00:00 2001 From: Alik Date: Thu, 19 Dec 2024 17:56:59 +0100 Subject: [PATCH] HCK-9173: comment out inactive schema statement in script (#156) * HCK-9173: comment out inactive schema statement in script * fix undefined --- forward_engineering/ddlProvider/ddlProvider.js | 16 +++++++++------- package.json | 5 +++-- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/forward_engineering/ddlProvider/ddlProvider.js b/forward_engineering/ddlProvider/ddlProvider.js index f147c59..8aa4af7 100644 --- a/forward_engineering/ddlProvider/ddlProvider.js +++ b/forward_engineering/ddlProvider/ddlProvider.js @@ -144,10 +144,11 @@ module.exports = (baseProvider, options, app) => { dbVersion, synonyms: data.synonyms, sequences: data.sequences, + isActivated: containerData.isActivated, }; }, - createSchema({ schemaName, ifNotExist, dbVersion, sequences }) { + createSchema({ schemaName, ifNotExist, dbVersion, sequences, isActivated = true }) { const emptyLineSeparator = '\n\n'; const statementTerminator = ';'; @@ -165,18 +166,19 @@ module.exports = (baseProvider, options, app) => { }); if (!usingTryCatchWrapper) { - return ( + return commentIfDeactivated( schemaStatement + - statementTerminator + - emptyLineSeparator + - alterSessionStatement + - schemaSequencesStatement + statementTerminator + + emptyLineSeparator + + alterSessionStatement + + schemaSequencesStatement, + { isActivated }, ); } const wrappedSchemaStatement = wrapIfNotExists(schemaStatement, ifNotExist, 1920); - return wrappedSchemaStatement + schemaSequencesStatement; + return commentIfDeactivated(wrappedSchemaStatement + schemaSequencesStatement, { isActivated }); }, hydrateColumn({ columnDefinition, jsonSchema, schemaData, definitionJsonSchema = {} }) { diff --git a/package.json b/package.json index 30e982c..1aea284 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,8 @@ }, "enableFetchSystemEntitiesCheckbox": true, "discoverRelationships": true, - "enableKeysMultipleAbrr": true + "enableKeysMultipleAbrr": true, + "FEScriptCommentsSupported": true } }, "description": "Hackolade plugin for Oracle and Autonomous databases", @@ -88,4 +89,4 @@ "prettier": "3.2.5", "simple-git-hooks": "2.11.1" } -} \ No newline at end of file +}