Skip to content

Commit

Permalink
HCK-9173: comment out inactive schema statement in script (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlikRakhmonov authored Dec 19, 2024
1 parent f1669bc commit 9aadf97
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 @@ -34,7 +34,9 @@ module.exports = {

callback(null, getAlterScript(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 @@ -43,7 +43,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 9aadf97

Please sign in to comment.