typeorm 0.3.11-dev.2e1c9fd → 0.3.11-dev.4a36d0e
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/driver/aurora-mysql/AuroraMysqlQueryRunner.js +21 -4
- package/browser/driver/aurora-mysql/AuroraMysqlQueryRunner.js.map +1 -1
- package/browser/driver/better-sqlite3/BetterSqlite3QueryRunner.js +0 -6
- package/browser/driver/better-sqlite3/BetterSqlite3QueryRunner.js.map +1 -1
- package/browser/driver/postgres/PostgresQueryRunner.js +3 -0
- package/browser/driver/postgres/PostgresQueryRunner.js.map +1 -1
- package/browser/driver/sqlite-abstract/AbstractSqliteDriver.js +6 -0
- package/browser/driver/sqlite-abstract/AbstractSqliteDriver.js.map +1 -1
- package/browser/find-options/operator/Any.d.ts +1 -1
- package/browser/find-options/operator/Any.js.map +1 -1
- package/browser/find-options/operator/ArrayContainedBy.d.ts +1 -1
- package/browser/find-options/operator/ArrayContainedBy.js.map +1 -1
- package/browser/find-options/operator/ArrayContains.d.ts +1 -1
- package/browser/find-options/operator/ArrayContains.js.map +1 -1
- package/browser/find-options/operator/ArrayOverlap.d.ts +1 -1
- package/browser/find-options/operator/ArrayOverlap.js.map +1 -1
- package/browser/find-options/operator/In.d.ts +1 -1
- package/browser/find-options/operator/In.js.map +1 -1
- package/browser/util/OrmUtils.js +2 -1
- package/browser/util/OrmUtils.js.map +1 -1
- package/driver/aurora-mysql/AuroraMysqlQueryRunner.js +21 -4
- package/driver/aurora-mysql/AuroraMysqlQueryRunner.js.map +1 -1
- package/driver/better-sqlite3/BetterSqlite3QueryRunner.js +0 -6
- package/driver/better-sqlite3/BetterSqlite3QueryRunner.js.map +1 -1
- package/driver/postgres/PostgresQueryRunner.js +3 -0
- package/driver/postgres/PostgresQueryRunner.js.map +1 -1
- package/driver/sqlite-abstract/AbstractSqliteDriver.js +6 -0
- package/driver/sqlite-abstract/AbstractSqliteDriver.js.map +1 -1
- package/find-options/operator/Any.d.ts +1 -1
- package/find-options/operator/Any.js.map +1 -1
- package/find-options/operator/ArrayContainedBy.d.ts +1 -1
- package/find-options/operator/ArrayContainedBy.js.map +1 -1
- package/find-options/operator/ArrayContains.d.ts +1 -1
- package/find-options/operator/ArrayContains.js.map +1 -1
- package/find-options/operator/ArrayOverlap.d.ts +1 -1
- package/find-options/operator/ArrayOverlap.js.map +1 -1
- package/find-options/operator/In.d.ts +1 -1
- package/find-options/operator/In.js.map +1 -1
- package/package.json +1 -1
- package/util/OrmUtils.js +2 -1
- package/util/OrmUtils.js.map +1 -1
|
@@ -1223,6 +1223,11 @@ export class AuroraMysqlQueryRunner extends BaseQueryRunner {
|
|
|
1223
1223
|
const tableColumn = new TableColumn();
|
|
1224
1224
|
tableColumn.name = dbColumn["COLUMN_NAME"];
|
|
1225
1225
|
tableColumn.type = dbColumn["DATA_TYPE"].toLowerCase();
|
|
1226
|
+
// Unsigned columns are handled differently when it comes to width.
|
|
1227
|
+
// Hence, we need to set the unsigned attribute before we check the width.
|
|
1228
|
+
tableColumn.unsigned = tableColumn.zerofill
|
|
1229
|
+
? true
|
|
1230
|
+
: dbColumn["COLUMN_TYPE"].indexOf("unsigned") !== -1;
|
|
1226
1231
|
if (this.driver.withWidthColumnTypes.indexOf(tableColumn.type) !== -1) {
|
|
1227
1232
|
const width = dbColumn["COLUMN_TYPE"].substring(dbColumn["COLUMN_TYPE"].indexOf("(") + 1, dbColumn["COLUMN_TYPE"].indexOf(")"));
|
|
1228
1233
|
tableColumn.width =
|
|
@@ -1269,9 +1274,6 @@ export class AuroraMysqlQueryRunner extends BaseQueryRunner {
|
|
|
1269
1274
|
});
|
|
1270
1275
|
tableColumn.zerofill =
|
|
1271
1276
|
dbColumn["COLUMN_TYPE"].indexOf("zerofill") !== -1;
|
|
1272
|
-
tableColumn.unsigned = tableColumn.zerofill
|
|
1273
|
-
? true
|
|
1274
|
-
: dbColumn["COLUMN_TYPE"].indexOf("unsigned") !== -1;
|
|
1275
1277
|
tableColumn.isGenerated =
|
|
1276
1278
|
dbColumn["EXTRA"].indexOf("auto_increment") !== -1;
|
|
1277
1279
|
if (tableColumn.isGenerated)
|
|
@@ -1673,7 +1675,22 @@ export class AuroraMysqlQueryRunner extends BaseQueryRunner {
|
|
|
1673
1675
|
this.connection.driver.dataTypeDefaults[column.type] &&
|
|
1674
1676
|
this.connection.driver.dataTypeDefaults[column.type].width;
|
|
1675
1677
|
if (defaultWidthForType) {
|
|
1676
|
-
|
|
1678
|
+
// In MariaDB & MySQL 5.7, the default widths of certain numeric types are 1 less than
|
|
1679
|
+
// the usual defaults when the column is unsigned.
|
|
1680
|
+
// This also applies to Aurora MySQL.
|
|
1681
|
+
const typesWithReducedUnsignedDefault = [
|
|
1682
|
+
"int",
|
|
1683
|
+
"tinyint",
|
|
1684
|
+
"smallint",
|
|
1685
|
+
"mediumint",
|
|
1686
|
+
];
|
|
1687
|
+
const needsAdjustment = typesWithReducedUnsignedDefault.indexOf(column.type) !== -1;
|
|
1688
|
+
if (column.unsigned && needsAdjustment) {
|
|
1689
|
+
return defaultWidthForType - 1 === width;
|
|
1690
|
+
}
|
|
1691
|
+
else {
|
|
1692
|
+
return defaultWidthForType === width;
|
|
1693
|
+
}
|
|
1677
1694
|
}
|
|
1678
1695
|
return false;
|
|
1679
1696
|
}
|