seperate ensureSchemaExists config
Signed-off-by: Chap Ambrose <cambrose@salesforce.com>
This commit is contained in:
@@ -321,7 +321,7 @@ export class PgConnector implements Connector {
|
||||
let schemaOverrides;
|
||||
if (this.getPluginDivisionModeConfig() === 'schema') {
|
||||
schemaOverrides = this.getSchemaOverrides(pluginId);
|
||||
if (this.getEnsureExistsConfig(pluginId)) {
|
||||
if (this.getEnsureSchemaExistsConfig(pluginId)) {
|
||||
try {
|
||||
await pgConnector.ensureSchemaExists!(pluginConfig, pluginId);
|
||||
} catch (error) {
|
||||
@@ -437,6 +437,15 @@ export class PgConnector implements Connector {
|
||||
);
|
||||
}
|
||||
|
||||
private getEnsureSchemaExistsConfig(pluginId: string): boolean {
|
||||
const baseConfig =
|
||||
this.config.getOptionalBoolean('ensureSchemaExists') ?? true;
|
||||
return (
|
||||
this.config.getOptionalBoolean(`${pluginPath(pluginId)}.ensureExists`) ??
|
||||
baseConfig
|
||||
);
|
||||
}
|
||||
|
||||
private getPluginDivisionModeConfig(): string {
|
||||
return this.config.getOptionalString('pluginDivisionMode') ?? 'database';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user