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 9ff3a58 commit 2a74fc1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion forward_engineering/ddlProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ module.exports = (baseProvider, options, app) => {
functions,
procedures,
comment,
isActivated,
}) {
let database;
const schemaComment = assignTemplates(templates.comment, {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -283,6 +285,7 @@ module.exports = (baseProvider, options, app) => {
? procedures.map(hydrateProcedure(containerData.name)).filter(filterProcedure)
: [],
comment: containerData.description,
isActivated: containerData.isActivated,
};
},

Expand Down

0 comments on commit 2a74fc1

Please sign in to comment.