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 3e56605 commit 19a761f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion forward_engineering/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ module.exports = {

callback(null, buildContainerLevelAlterScript(data.jsonSchema, udtTypeMap, data));
} else {
let script = `${getKeyspaceStatement(data.containerData)}\n\n${getCreateTableScript(data, true)}`;
const isKeyspaceActivated = retrieveIsItemActivated(data.containerData);
const statement = `${getKeyspaceStatement(data.containerData)}\n\n${getCreateTableScript(data, isKeyspaceActivated)}`;
const script = commentDeactivatedStatement(statement, isKeyspaceActivated);
callback(null, script);
}
} catch (e) {
Expand Down
2 changes: 1 addition & 1 deletion forward_engineering/helpers/createHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const getCreateTableScript = (data, isKeyspaceActivated) => {

const cqlScript = getScript([UDF, UDA, ...UDT, table, indexes]);

return commentDeactivatedStatement(cqlScript, isEntityActivated && isKeyspaceActivated);
return commentDeactivatedStatement(cqlScript, isEntityActivated, isKeyspaceActivated);
};

const getScript = structure => {
Expand Down

0 comments on commit 19a761f

Please sign in to comment.