From 6daf3ab9d9afa6abf6696e51724b7abbd53ec346 Mon Sep 17 00:00:00 2001 From: Alik Rakhmonov Date: Thu, 19 Dec 2024 13:03:38 +0100 Subject: [PATCH 1/2] HCK-9173: comment out inactive schema statement in script --- forward_engineering/ddlProvider/ddlProvider.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/forward_engineering/ddlProvider/ddlProvider.js b/forward_engineering/ddlProvider/ddlProvider.js index 49ae382..3258ac6 100644 --- a/forward_engineering/ddlProvider/ddlProvider.js +++ b/forward_engineering/ddlProvider/ddlProvider.js @@ -118,7 +118,7 @@ module.exports = (baseProvider, options, app) => { }); }, - createSchema({ schemaName, ifNotExist, comments, udfs, procedures }) { + createSchema({ schemaName, ifNotExist, comments, udfs, procedures, isActivated }) { const comment = assignTemplates(templates.comment, { object: 'SCHEMA', objectName: wrapInQuotes(schemaName), @@ -134,12 +134,13 @@ module.exports = (baseProvider, options, app) => { const createFunctionStatement = getFunctionsScript(schemaName, udfs); const createProceduresStatement = getProceduresScript(schemaName, procedures); - return _.chain([schemaStatement, createFunctionStatement, createProceduresStatement]) + const statement = _.chain([schemaStatement, createFunctionStatement, createProceduresStatement]) .compact() .map(_.trim) .join('\n\n') .trim() .value(); + return commentIfDeactivated(statement, { isActivated }); }, createTable( @@ -704,6 +705,7 @@ module.exports = (baseProvider, options, app) => { udfs: data?.udfs || [], procedures: data?.procedures || [], dbVersion, + isActivated: containerData.isActivated, }; }, From eb428ecaf2787263bd4e074d160935d96eeec3c0 Mon Sep 17 00:00:00 2001 From: Alik Rakhmonov Date: Thu, 19 Dec 2024 16:58:12 +0100 Subject: [PATCH 2/2] fix --- forward_engineering/ddlProvider/ddlProvider.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/forward_engineering/ddlProvider/ddlProvider.js b/forward_engineering/ddlProvider/ddlProvider.js index 3258ac6..57fb45a 100644 --- a/forward_engineering/ddlProvider/ddlProvider.js +++ b/forward_engineering/ddlProvider/ddlProvider.js @@ -118,7 +118,7 @@ module.exports = (baseProvider, options, app) => { }); }, - createSchema({ schemaName, ifNotExist, comments, udfs, procedures, isActivated }) { + createSchema({ schemaName, ifNotExist, comments, udfs, procedures, isActivated = true }) { const comment = assignTemplates(templates.comment, { object: 'SCHEMA', objectName: wrapInQuotes(schemaName),