diff --git a/src/drivers/MssqlDriver.ts b/src/drivers/MssqlDriver.ts index 14709e1..a610581 100644 --- a/src/drivers/MssqlDriver.ts +++ b/src/drivers/MssqlDriver.ts @@ -89,7 +89,10 @@ WHERE TABLE_TYPE='BASE TABLE' and TABLE_SCHEMA in (${schema}) AND TABLE_CATALOG entities.forEach(ent => { response .filter(filterVal => { - return filterVal.TABLE_NAME === ent.tscName && filterVal.TABLE_SCHEMA === ent.schema; + return ( + filterVal.TABLE_NAME === ent.tscName && + filterVal.TABLE_SCHEMA === ent.schema + ); }) .forEach(resp => { const tscName = resp.COLUMN_NAME; @@ -298,7 +301,9 @@ WHERE TABLE_TYPE='BASE TABLE' and TABLE_SCHEMA in (${schema}) AND TABLE_CATALOG entities.forEach(ent => { const entityIndices = response.filter( - filterVal => filterVal.TableName === ent.tscName && filterVal.TableSchema === ent.schema + filterVal => + filterVal.TableName === ent.tscName && + filterVal.TableSchema === ent.schema ); const indexNames = new Set(entityIndices.map(v => v.IndexName)); indexNames.forEach(indexName => { @@ -514,9 +519,7 @@ WHERE TABLE_TYPE='BASE TABLE' and TABLE_SCHEMA in (${schema}) AND TABLE_CATALOG if (defaultValue.startsWith("(") && defaultValue.endsWith(")")) { defaultValue = defaultValue.slice(1, -1); } - if (defaultValue.startsWith(`'`)) { - return `() => "${defaultValue}"`; - } - return `() => "${defaultValue}"`; + + return `() => \`${defaultValue}\``; } } diff --git a/src/drivers/MysqlDriver.ts b/src/drivers/MysqlDriver.ts index 59a5e33..3dfaa28 100644 --- a/src/drivers/MysqlDriver.ts +++ b/src/drivers/MysqlDriver.ts @@ -529,6 +529,7 @@ export default class MysqlDriver extends AbstractDriver { if (dataType === "set") { return `() => ['${defaultValue.split(",").join("','")}']`; } - return `() => "'${defaultValue}'"`; + + return `() => \`${defaultValue}\``; } } diff --git a/src/drivers/OracleDriver.ts b/src/drivers/OracleDriver.ts index 9518d54..2ac5791 100644 --- a/src/drivers/OracleDriver.ts +++ b/src/drivers/OracleDriver.ts @@ -416,9 +416,7 @@ export default class OracleDriver extends AbstractDriver { if (defaultVal.endsWith(" ")) { defaultVal = defaultVal.slice(0, -1); } - if (defaultVal.startsWith(`'`)) { - return `() => "${defaultVal}"`; - } - return `() => "${defaultVal}"`; + + return `() => \`${defaultVal}\``; } } diff --git a/src/drivers/PostgresDriver.ts b/src/drivers/PostgresDriver.ts index 174becb..a032f58 100644 --- a/src/drivers/PostgresDriver.ts +++ b/src/drivers/PostgresDriver.ts @@ -655,9 +655,7 @@ export default class PostgresDriver extends AbstractDriver { return undefined; } defaultValue = defaultValue.replace(/'::[\w ]*/, "'"); - if (defaultValue.startsWith(`'`)) { - return `() => "${defaultValue}"`; - } - return `() => "${defaultValue}"`; + + return `() => \`${defaultValue}\``; } } diff --git a/src/drivers/SqliteDriver.ts b/src/drivers/SqliteDriver.ts index 2eee238..e29140c 100644 --- a/src/drivers/SqliteDriver.ts +++ b/src/drivers/SqliteDriver.ts @@ -436,9 +436,7 @@ export default class SqliteDriver extends AbstractDriver { if (!defVal) { return undefined; } - if (defVal.startsWith(`'`)) { - return `() => "${defVal}"`; - } - return `() => "${defVal}"`; + + return `() => \`${defVal}\``; } }