From fcf44031cba6e02acd602524ecc5b5c72d7d4b65 Mon Sep 17 00:00:00 2001 From: Alik Rakhmonov Date: Thu, 19 Dec 2024 13:04:07 +0100 Subject: [PATCH] HCK-9173: comment out inactive schema statement in script --- forward_engineering/ddlProvider.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/forward_engineering/ddlProvider.js b/forward_engineering/ddlProvider.js index 7ab9d6d..48a7c26 100644 --- a/forward_engineering/ddlProvider.js +++ b/forward_engineering/ddlProvider.js @@ -45,7 +45,7 @@ module.exports = (baseProvider, options, app) => { const terminator = getTerminator(options); return { - createSchema({ schemaName, databaseName, ifNotExist, comment }) { + createSchema({ schemaName, databaseName, ifNotExist, comment, isActivated }) { const schemaTerminator = ifNotExist ? ';' : terminator; const schemaComment = comment @@ -56,11 +56,14 @@ module.exports = (baseProvider, options, app) => { }) : ''; - let schemaStatement = assignTemplates(templates.createSchema, { - name: schemaName, - terminator: schemaTerminator, - comment: schemaComment ? `\n\n${schemaComment}` : '', - }); + let schemaStatement = commentIfDeactivated( + assignTemplates(templates.createSchema, { + name: schemaName, + terminator: schemaTerminator, + comment: schemaComment ? `\n\n${schemaComment}` : '', + }), + { isActivated }, + ); if (!databaseName) { return ifNotExist @@ -500,6 +503,7 @@ module.exports = (baseProvider, options, app) => { databaseName: containerData.databaseName, ifNotExist: containerData.ifNotExist, comment: containerData.role?.description ?? containerData.description, + isActivated: containerData.isActivated, }; },