@mikro-orm/postgresql 6.3.11-dev.10 → 6.3.11-dev.11
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/PostgreSqlPlatform.d.ts +1 -1
- package/PostgreSqlPlatform.js +5 -5
- package/package.json +3 -3
package/PostgreSqlPlatform.d.ts
CHANGED
|
@@ -86,7 +86,7 @@ export declare class PostgreSqlPlatform extends AbstractSqlPlatform {
|
|
|
86
86
|
getDefaultSchemaName(): string | undefined;
|
|
87
87
|
/**
|
|
88
88
|
* Returns the default name of index for the given columns
|
|
89
|
-
* cannot go past
|
|
89
|
+
* cannot go past 63 character length for identifiers in MySQL
|
|
90
90
|
*/
|
|
91
91
|
getIndexName(tableName: string, columns: string[], type: 'index' | 'unique' | 'foreign' | 'primary' | 'sequence'): string;
|
|
92
92
|
getDefaultPrimaryName(tableName: string, columns: string[]): string;
|
package/PostgreSqlPlatform.js
CHANGED
|
@@ -331,19 +331,19 @@ class PostgreSqlPlatform extends knex_1.AbstractSqlPlatform {
|
|
|
331
331
|
}
|
|
332
332
|
/**
|
|
333
333
|
* Returns the default name of index for the given columns
|
|
334
|
-
* cannot go past
|
|
334
|
+
* cannot go past 63 character length for identifiers in MySQL
|
|
335
335
|
*/
|
|
336
336
|
getIndexName(tableName, columns, type) {
|
|
337
337
|
const indexName = super.getIndexName(tableName, columns, type);
|
|
338
|
-
if (indexName.length >
|
|
339
|
-
return `${indexName.substring(0,
|
|
338
|
+
if (indexName.length > 63) {
|
|
339
|
+
return `${indexName.substring(0, 55 - type.length)}_${core_1.Utils.hash(indexName, 5)}_${type}`;
|
|
340
340
|
}
|
|
341
341
|
return indexName;
|
|
342
342
|
}
|
|
343
343
|
getDefaultPrimaryName(tableName, columns) {
|
|
344
344
|
const indexName = `${tableName}_pkey`;
|
|
345
|
-
if (indexName.length >
|
|
346
|
-
return `${indexName.substring(0,
|
|
345
|
+
if (indexName.length > 63) {
|
|
346
|
+
return `${indexName.substring(0, 55 - 'primary'.length)}_${core_1.Utils.hash(indexName, 5)}_primary`;
|
|
347
347
|
}
|
|
348
348
|
return indexName;
|
|
349
349
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/postgresql",
|
|
3
|
-
"version": "6.3.11-dev.
|
|
3
|
+
"version": "6.3.11-dev.11",
|
|
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",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"access": "public"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@mikro-orm/knex": "6.3.11-dev.
|
|
61
|
+
"@mikro-orm/knex": "6.3.11-dev.11",
|
|
62
62
|
"pg": "8.13.0",
|
|
63
63
|
"postgres-array": "3.0.2",
|
|
64
64
|
"postgres-date": "2.1.0",
|
|
@@ -68,6 +68,6 @@
|
|
|
68
68
|
"@mikro-orm/core": "^6.3.10"
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
71
|
-
"@mikro-orm/core": "6.3.11-dev.
|
|
71
|
+
"@mikro-orm/core": "6.3.11-dev.11"
|
|
72
72
|
}
|
|
73
73
|
}
|