From 2a74fc1b1c8fbf80e27dbd185aa2178b163d2909 Mon Sep 17 00:00:00 2001 From: Alik Rakhmonov Date: Thu, 19 Dec 2024 13:04:28 +0100 Subject: [PATCH] HCK-9173: comment out inactive schema statement in script --- forward_engineering/ddlProvider.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/forward_engineering/ddlProvider.js b/forward_engineering/ddlProvider.js index deaa8d5..bda5148 100644 --- a/forward_engineering/ddlProvider.js +++ b/forward_engineering/ddlProvider.js @@ -53,6 +53,7 @@ module.exports = (baseProvider, options, app) => { functions, procedures, comment, + isActivated, }) { let database; const schemaComment = assignTemplates(templates.comment, { @@ -86,9 +87,10 @@ module.exports = (baseProvider, options, app) => { const userProcedures = procedures.map(procedure => assignTemplates(templates.createProcedure, setOrReplace(procedure)), ); - return [database, comment ? _.trimStart(schemaComment) : '', ...userFunctions, ...userProcedures] + const statement = [database, comment ? _.trimStart(schemaComment) : '', ...userFunctions, ...userProcedures] .filter(Boolean) .join('\n'); + return commentIfDeactivated(statement, { isActivated }); }, createTable(tableData, isActivated) { @@ -283,6 +285,7 @@ module.exports = (baseProvider, options, app) => { ? procedures.map(hydrateProcedure(containerData.name)).filter(filterProcedure) : [], comment: containerData.description, + isActivated: containerData.isActivated, }; },