-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Open
Description
Description
There issue Option to remove database name from migrations was fixed by this PR: fix: prevent using absolute table path in migrations unless required.
The Problem
The SapQueryRunner was not adopted in this PR. So the generated migration files still have the schema name in it.
The Solution
SapQueryRunner.ts:
/**
* Escapes given table or view path.
*/
escapePath(target) {
const { schema, tableName } = this.driver.parseTableName(target);
if (schema) {
return `"${schema}"."${tableName}"`;
}
return `"${tableName}"`;
}should be adapted to:
/**
* Escapes given table or view path.
*/
escapePath(target) {
const { schema, tableName } = this.driver.parseTableName(target);
if (schema && schema !== this.driver.schema) {
return `"${schema}"."${tableName}"`;
}
return `"${tableName}"`;
}As seen here for the other QueryRunners.
Relevant Database Driver(s)
- sap