@mikro-orm/knex 6.4.3-dev.0 → 6.4.3-dev.10
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/README.md
CHANGED
|
@@ -299,13 +299,13 @@ Or if you want to use UUID primary keys:
|
|
|
299
299
|
**`./entities/UuidBook.ts`**
|
|
300
300
|
|
|
301
301
|
```typescript
|
|
302
|
-
import {
|
|
302
|
+
import { randomUUID } from 'node:crypto';
|
|
303
303
|
|
|
304
304
|
@Entity()
|
|
305
305
|
export class UuidBook {
|
|
306
306
|
|
|
307
307
|
@PrimaryKey()
|
|
308
|
-
uuid =
|
|
308
|
+
uuid = randomUUID();
|
|
309
309
|
|
|
310
310
|
}
|
|
311
311
|
```
|
|
@@ -22,6 +22,7 @@ export declare class MySqlPlatform extends AbstractSqlPlatform {
|
|
|
22
22
|
scale?: number;
|
|
23
23
|
}): string;
|
|
24
24
|
getDefaultMappedType(type: string): Type<unknown>;
|
|
25
|
+
isNumericColumn(mappedType: Type<unknown>): boolean;
|
|
25
26
|
supportsUnsigned(): boolean;
|
|
26
27
|
/**
|
|
27
28
|
* Returns the default name of index for the given columns
|
|
@@ -49,6 +49,9 @@ class MySqlPlatform extends AbstractSqlPlatform_1.AbstractSqlPlatform {
|
|
|
49
49
|
}
|
|
50
50
|
return super.getDefaultMappedType(type);
|
|
51
51
|
}
|
|
52
|
+
isNumericColumn(mappedType) {
|
|
53
|
+
return super.isNumericColumn(mappedType) || [core_1.DecimalType, core_1.DoubleType].some(t => mappedType instanceof t);
|
|
54
|
+
}
|
|
52
55
|
supportsUnsigned() {
|
|
53
56
|
return true;
|
|
54
57
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/knex",
|
|
3
|
-
"version": "6.4.3-dev.
|
|
3
|
+
"version": "6.4.3-dev.10",
|
|
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",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"@mikro-orm/core": "^6.4.2"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
|
-
"@mikro-orm/core": "6.4.3-dev.
|
|
69
|
+
"@mikro-orm/core": "6.4.3-dev.10",
|
|
70
70
|
"better-sqlite3": "*",
|
|
71
71
|
"libsql": "*",
|
|
72
72
|
"mariadb": "*"
|
package/schema/DatabaseTable.js
CHANGED
|
@@ -607,6 +607,7 @@ class DatabaseTable {
|
|
|
607
607
|
fkOptions.updateRule = fk.updateRule?.toLowerCase();
|
|
608
608
|
fkOptions.deleteRule = fk.deleteRule?.toLowerCase();
|
|
609
609
|
fkOptions.deferMode = fk.deferMode;
|
|
610
|
+
fkOptions.columnTypes = fk.columnNames.map(col => this.getColumn(col).type);
|
|
610
611
|
}
|
|
611
612
|
return {
|
|
612
613
|
name: prop,
|