@mikro-orm/knex 6.5.0 → 6.5.2-dev.0
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 +3 -3
- package/schema/DatabaseTable.js +9 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/knex",
|
|
3
|
-
"version": "6.5.0",
|
|
3
|
+
"version": "6.5.2-dev.0",
|
|
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
|
"main": "index.js",
|
|
6
6
|
"module": "index.mjs",
|
|
@@ -63,10 +63,10 @@
|
|
|
63
63
|
"sqlstring": "2.3.3"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
|
-
"@mikro-orm/core": "^6.5.
|
|
66
|
+
"@mikro-orm/core": "^6.5.1"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
|
-
"@mikro-orm/core": "
|
|
69
|
+
"@mikro-orm/core": "6.5.2-dev.0",
|
|
70
70
|
"better-sqlite3": "*",
|
|
71
71
|
"libsql": "*",
|
|
72
72
|
"mariadb": "*"
|
package/schema/DatabaseTable.js
CHANGED
|
@@ -700,14 +700,19 @@ class DatabaseTable {
|
|
|
700
700
|
}
|
|
701
701
|
return '' + val;
|
|
702
702
|
}
|
|
703
|
-
processIndexExpression(expression, meta) {
|
|
703
|
+
processIndexExpression(indexName, expression, meta) {
|
|
704
704
|
if (expression instanceof Function) {
|
|
705
|
-
const
|
|
705
|
+
const table = {
|
|
706
|
+
name: this.name,
|
|
707
|
+
schema: this.schema,
|
|
708
|
+
toString() {
|
|
706
709
|
if (this.schema) {
|
|
707
710
|
return `${this.schema}.${this.name}`;
|
|
708
711
|
}
|
|
709
712
|
return this.name;
|
|
710
|
-
}
|
|
713
|
+
},
|
|
714
|
+
};
|
|
715
|
+
const exp = expression(table, meta.createColumnMappingObject(), indexName);
|
|
711
716
|
return exp instanceof core_1.RawQueryFragment ? this.platform.formatQuery(exp.sql, exp.params) : exp;
|
|
712
717
|
}
|
|
713
718
|
return expression;
|
|
@@ -753,7 +758,7 @@ class DatabaseTable {
|
|
|
753
758
|
primary: type === 'primary',
|
|
754
759
|
unique: type !== 'index',
|
|
755
760
|
type: index.type,
|
|
756
|
-
expression: this.processIndexExpression(index.expression, meta),
|
|
761
|
+
expression: this.processIndexExpression(name, index.expression, meta),
|
|
757
762
|
options: index.options,
|
|
758
763
|
deferMode: index.deferMode,
|
|
759
764
|
});
|