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 536c12e commit fcf4403
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions forward_engineering/ddlProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -500,6 +503,7 @@ module.exports = (baseProvider, options, app) => {
databaseName: containerData.databaseName,
ifNotExist: containerData.ifNotExist,
comment: containerData.role?.description ?? containerData.description,
isActivated: containerData.isActivated,
};
},

Expand Down

0 comments on commit fcf4403

Please sign in to comment.