Skip to content

Commit

Permalink
HCK-9173: comment out inactive schema statement in script (#38)
Browse files Browse the repository at this point in the history
* HCK-9173: comment out inactive schema statement in script

* fix undefined
  • Loading branch information
AlikRakhmonov authored Dec 19, 2024
1 parent c8b1f44 commit 9a493a4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion forward_engineering/ddlProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ module.exports = (baseProvider, options, app) => {
procedures,
tablespaces,
useDb = true,
isActivated = true,
}) {
let dbOptions = '';
dbOptions += characterSet ? tab(`\nCHARACTER SET = '${characterSet}'`) : '';
Expand All @@ -64,7 +65,10 @@ module.exports = (baseProvider, options, app) => {
.map(tableSpace => this.createTableSpace(tableSpace))
.filter(Boolean);

return [...tableSpaceStatements, databaseStatement, ...udfStatements, ...procStatements].join('\n');
return commentIfDeactivated(
[...tableSpaceStatements, databaseStatement, ...udfStatements, ...procStatements].join('\n'),
{ isActivated },
);
},

dropDatabase(dropDbData) {
Expand Down Expand Up @@ -805,6 +809,7 @@ module.exports = (baseProvider, options, app) => {
udfs: (data?.udfs || []).map(this.hydrateUdf),
procedures: (data?.procedures || []).map(this.hydrateProcedure),
tablespaces: (data?.modelData?.[2]?.tablespaces || []).map(this.hydrateTableSpace),
isActivated: containerData.isActivated,
};
},

Expand Down

0 comments on commit 9a493a4

Please sign in to comment.