Skip to content

Commit

Permalink
HCK-9173: comment out inactive schema statement in script (#156)
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 da0eabe commit 8f4c95b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
16 changes: 9 additions & 7 deletions forward_engineering/ddlProvider/ddlProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,11 @@ module.exports = (baseProvider, options, app) => {
dbVersion,
synonyms: data.synonyms,
sequences: data.sequences,
isActivated: containerData.isActivated,
};
},

createSchema({ schemaName, ifNotExist, dbVersion, sequences }) {
createSchema({ schemaName, ifNotExist, dbVersion, sequences, isActivated = true }) {
const emptyLineSeparator = '\n\n';
const statementTerminator = ';';

Expand All @@ -165,18 +166,19 @@ module.exports = (baseProvider, options, app) => {
});

if (!usingTryCatchWrapper) {
return (
return commentIfDeactivated(
schemaStatement +
statementTerminator +
emptyLineSeparator +
alterSessionStatement +
schemaSequencesStatement
statementTerminator +
emptyLineSeparator +
alterSessionStatement +
schemaSequencesStatement,
{ isActivated },
);
}

const wrappedSchemaStatement = wrapIfNotExists(schemaStatement, ifNotExist, 1920);

return wrappedSchemaStatement + schemaSequencesStatement;
return commentIfDeactivated(wrappedSchemaStatement + schemaSequencesStatement, { isActivated });
},

hydrateColumn({ columnDefinition, jsonSchema, schemaData, definitionJsonSchema = {} }) {
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@
},
"enableFetchSystemEntitiesCheckbox": true,
"discoverRelationships": true,
"enableKeysMultipleAbrr": true
"enableKeysMultipleAbrr": true,
"FEScriptCommentsSupported": true
}
},
"description": "Hackolade plugin for Oracle and Autonomous databases",
Expand Down Expand Up @@ -88,4 +89,4 @@
"prettier": "3.2.5",
"simple-git-hooks": "2.11.1"
}
}
}

0 comments on commit 8f4c95b

Please sign in to comment.