Skip to content

Commit

Permalink
HCK-9173: comment out inactive schema statement in script
Browse files Browse the repository at this point in the history
  • Loading branch information
AlikRakhmonov committed Dec 19, 2024
1 parent f2d629c commit 6daf3ab
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions forward_engineering/ddlProvider/ddlProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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(
Expand Down Expand Up @@ -704,6 +705,7 @@ module.exports = (baseProvider, options, app) => {
udfs: data?.udfs || [],
procedures: data?.procedures || [],
dbVersion,
isActivated: containerData.isActivated,
};
},

Expand Down

0 comments on commit 6daf3ab

Please sign in to comment.