set ensureSchemaExists to false to match current behavior

Signed-off-by: Chap Ambrose <cambrose@salesforce.com>
This commit is contained in:
Chap Ambrose
2024-05-01 10:07:08 -05:00
parent ccc8851bd0
commit 0b8b8e80c8
2 changed files with 6 additions and 3 deletions
+1 -1
View File
@@ -2,4 +2,4 @@
'@backstage/backend-common': patch
---
add ensureSchemaExists backend database config
Added config prop `ensureSchemaExists` to support postgres instances where user can create schemas but not databases.
@@ -321,7 +321,10 @@ export class PgConnector implements Connector {
let schemaOverrides;
if (this.getPluginDivisionModeConfig() === 'schema') {
schemaOverrides = this.getSchemaOverrides(pluginId);
if (this.getEnsureSchemaExistsConfig(pluginId)) {
if (
this.getEnsureSchemaExistsConfig(pluginId) ||
this.getEnsureExistsConfig(pluginId)
) {
try {
await pgConnector.ensureSchemaExists!(pluginConfig, pluginId);
} catch (error) {
@@ -439,7 +442,7 @@ export class PgConnector implements Connector {
private getEnsureSchemaExistsConfig(pluginId: string): boolean {
const baseConfig =
this.config.getOptionalBoolean('ensureSchemaExists') ?? true;
this.config.getOptionalBoolean('ensureSchemaExists') ?? false;
return (
this.config.getOptionalBoolean(
`${pluginPath(pluginId)}.getEnsureSchemaExistsConfig`,