@mikro-orm/sql 7.3.0-dev.6 → 7.3.0-dev.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/sql",
3
- "version": "7.3.0-dev.6",
3
+ "version": "7.3.0-dev.7",
4
4
  "description": "TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, PostgreSQL and SQLite databases as well as usage with vanilla JavaScript.",
5
5
  "keywords": [
6
6
  "data-mapper",
@@ -53,7 +53,7 @@
53
53
  "@mikro-orm/core": "^7.2.2"
54
54
  },
55
55
  "peerDependencies": {
56
- "@mikro-orm/core": "7.3.0-dev.6"
56
+ "@mikro-orm/core": "7.3.0-dev.7"
57
57
  },
58
58
  "engines": {
59
59
  "node": ">= 22.17.0"
@@ -478,6 +478,15 @@ export class SchemaHelper {
478
478
  ret.push(this.createIndex(index, diff.toTable));
479
479
  }
480
480
  for (const index of Object.values(diff.changedIndexes)) {
481
+ const addedColumn = diff.addedColumns[index.columnNames[0]];
482
+ // an added autoincrement PK column already declares the primary key inline
483
+ if (index.primary &&
484
+ !index.composite &&
485
+ addedColumn?.autoincrement &&
486
+ addedColumn.primary &&
487
+ !this.hasNonDefaultPrimaryKeyName(diff.toTable)) {
488
+ continue;
489
+ }
481
490
  ret.push(this.createIndex(index, diff.toTable, true));
482
491
  }
483
492
  for (const [oldIndexName, index] of Object.entries(diff.renamedIndexes)) {