diff --git a/forward_engineering/api.js b/forward_engineering/api.js index 1f86e5a..579d343 100644 --- a/forward_engineering/api.js +++ b/forward_engineering/api.js @@ -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) { diff --git a/forward_engineering/helpers/createHelper.js b/forward_engineering/helpers/createHelper.js index aa2ad19..ccf8c71 100644 --- a/forward_engineering/helpers/createHelper.js +++ b/forward_engineering/helpers/createHelper.js @@ -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 => {