fix: database config is already prefixed
Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>
This commit is contained in:
@@ -106,12 +106,8 @@ describe('DatabaseManagerImpl', () => {
|
||||
const impl = new DatabaseManagerImpl(
|
||||
new ConfigReader({
|
||||
client: 'pg',
|
||||
backend: {
|
||||
database: {
|
||||
skipMigrations: true,
|
||||
plugin: { plugin1: { skipMigrations: true } },
|
||||
},
|
||||
},
|
||||
skipMigrations: true,
|
||||
plugin: { plugin1: { skipMigrations: true } },
|
||||
}),
|
||||
{
|
||||
pg: connector,
|
||||
@@ -139,9 +135,7 @@ describe('DatabaseManagerImpl', () => {
|
||||
const impl = new DatabaseManagerImpl(
|
||||
new ConfigReader({
|
||||
client: 'pg',
|
||||
backend: {
|
||||
database: { plugin: { plugin1: { skipMigrations: true } } },
|
||||
},
|
||||
plugin: { plugin1: { skipMigrations: true } },
|
||||
}),
|
||||
{
|
||||
pg: connector,
|
||||
@@ -158,12 +152,8 @@ describe('DatabaseManagerImpl', () => {
|
||||
const impl2 = new DatabaseManagerImpl(
|
||||
new ConfigReader({
|
||||
client: 'pg',
|
||||
backend: {
|
||||
database: {
|
||||
skipMigrations: true,
|
||||
plugin: { plugin1: { skipMigrations: false } },
|
||||
},
|
||||
},
|
||||
skipMigrations: true,
|
||||
plugin: { plugin1: { skipMigrations: false } },
|
||||
}),
|
||||
{
|
||||
pg: connector,
|
||||
|
||||
@@ -96,10 +96,8 @@ export class DatabaseManagerImpl {
|
||||
|
||||
const skip =
|
||||
this.options?.migrations?.skip ??
|
||||
this.config.getOptionalBoolean(
|
||||
`backend.database.plugin.${pluginId}.skipMigrations`,
|
||||
) ??
|
||||
this.config.getOptionalBoolean('backend.database.skipMigrations') ??
|
||||
this.config.getOptionalBoolean(`plugin.${pluginId}.skipMigrations`) ??
|
||||
this.config.getOptionalBoolean('skipMigrations') ??
|
||||
false;
|
||||
|
||||
return { getClient, migrations: { skip } };
|
||||
|
||||
Reference in New Issue
Block a user