Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HCK-9173: comment out inactive schema statement in script #125

Merged
merged 3 commits into from
Dec 19, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading