@mikro-orm/sql 7.2.6-dev.13 → 7.2.6-dev.15

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.2.6-dev.13",
3
+ "version": "7.2.6-dev.15",
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.5"
54
54
  },
55
55
  "peerDependencies": {
56
- "@mikro-orm/core": "7.2.6-dev.13"
56
+ "@mikro-orm/core": "7.2.6-dev.15"
57
57
  },
58
58
  "engines": {
59
59
  "node": ">= 22.17.0"
@@ -866,16 +866,10 @@ export class SchemaComparator {
866
866
  if (cols1.length === 0 && cols2.length === 0) {
867
867
  return true;
868
868
  }
869
- // If only one has column options, they don't match
870
- if (cols1.length !== cols2.length) {
871
- return false;
872
- }
873
- // Compare each column's options
874
- // Note: We don't check c1.name !== c2.name because the indexes already have matching columnNames
875
- // and the columns array is derived from those same column names
876
- for (let i = 0; i < cols1.length; i++) {
877
- const c1 = cols1[i];
878
- const c2 = cols2[i];
869
+ // introspection may omit entries for columns with default options, so match them by name
870
+ for (const name of index1.columnNames) {
871
+ const c1 = cols1.find(c => c.name === name) ?? { name };
872
+ const c2 = cols2.find(c => c.name === name) ?? { name };
879
873
  const sort1 = c1.sort?.toUpperCase() ?? 'ASC';
880
874
  const sort2 = c2.sort?.toUpperCase() ?? 'ASC';
881
875
  if (sort1 !== sort2) {