refactor(core): Add support for implicit schema in postgres migrations (#5233)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2023-01-24 10:55:20 +01:00
committed by GitHub
parent 726b573eab
commit a86c9a628b
28 changed files with 154 additions and 430 deletions

View File

@@ -91,16 +91,7 @@ export async function runInBatches(
} while (batchedQueryResults.length === limit);
}
export const getTablePrefix = () => {
const tablePrefix = config.getEnv('database.tablePrefix');
if (config.getEnv('database.type') === 'postgresdb') {
const schema = config.getEnv('database.postgresdb.schema');
return [schema, tablePrefix].join('.');
}
return tablePrefix;
};
export const getTablePrefix = () => config.getEnv('database.tablePrefix');
export const escapeQuery = (
queryRunner: QueryRunner,