From 222c515ecc5075d385a18d073baf915edc5b0ced Mon Sep 17 00:00:00 2001 From: Alik Rakhmonov Date: Thu, 19 Dec 2024 13:04:47 +0100 Subject: [PATCH] HCK-9173: comment out inactive schema statement in script --- forward_engineering/ddlProvider.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/forward_engineering/ddlProvider.js b/forward_engineering/ddlProvider.js index 6d2919d..99e052f 100644 --- a/forward_engineering/ddlProvider.js +++ b/forward_engineering/ddlProvider.js @@ -46,6 +46,7 @@ module.exports = (baseProvider, options, app) => { procedures, tablespaces, useDb = true, + isActivated, }) { let dbOptions = ''; dbOptions += characterSet ? tab(`\nCHARACTER SET = '${characterSet}'`) : ''; @@ -64,7 +65,10 @@ module.exports = (baseProvider, options, app) => { .map(tableSpace => this.createTableSpace(tableSpace)) .filter(Boolean); - return [...tableSpaceStatements, databaseStatement, ...udfStatements, ...procStatements].join('\n'); + return commentIfDeactivated( + [...tableSpaceStatements, databaseStatement, ...udfStatements, ...procStatements].join('\n'), + { isActivated }, + ); }, dropDatabase(dropDbData) { @@ -805,6 +809,7 @@ module.exports = (baseProvider, options, app) => { udfs: (data?.udfs || []).map(this.hydrateUdf), procedures: (data?.procedures || []).map(this.hydrateProcedure), tablespaces: (data?.modelData?.[2]?.tablespaces || []).map(this.hydrateTableSpace), + isActivated: containerData.isActivated, }; },