@mikro-orm/postgresql 6.6.14-dev.2 → 6.6.14-dev.3
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
CHANGED
|
@@ -43,6 +43,7 @@ export declare class PostgreSqlPlatform extends AbstractSqlPlatform {
|
|
|
43
43
|
precision?: number;
|
|
44
44
|
scale?: number;
|
|
45
45
|
autoincrement?: boolean;
|
|
46
|
+
columnTypes?: string[];
|
|
46
47
|
}): string;
|
|
47
48
|
getMappedType(type: string): Type<unknown>;
|
|
48
49
|
getRegExpOperator(val?: unknown, flags?: string): string;
|
package/PostgreSqlPlatform.js
CHANGED
|
@@ -124,6 +124,12 @@ class PostgreSqlPlatform extends knex_1.AbstractSqlPlatform {
|
|
|
124
124
|
if (['interval'].includes(simpleType)) {
|
|
125
125
|
return this.getIntervalTypeDeclarationSQL(options);
|
|
126
126
|
}
|
|
127
|
+
// TimeType.getColumnType drops the timezone qualifier, so detect tz aliases from the original column type.
|
|
128
|
+
const originalType = options.columnTypes?.[0]?.toLowerCase() ?? type;
|
|
129
|
+
if (/^timetz\b/.test(originalType) || /^time\s+with\s+time\s+zone\b/.test(originalType)) {
|
|
130
|
+
const length = options.length ?? this.getDefaultDateTimeLength();
|
|
131
|
+
return `timetz(${length})`;
|
|
132
|
+
}
|
|
127
133
|
return super.normalizeColumnType(type, options);
|
|
128
134
|
}
|
|
129
135
|
getMappedType(type) {
|
|
@@ -46,6 +46,7 @@ export declare class PostgreSqlSchemaHelper extends SchemaHelper {
|
|
|
46
46
|
disableForeignKeysSQL(): string;
|
|
47
47
|
enableForeignKeysSQL(): string;
|
|
48
48
|
getRenameIndexSQL(tableName: string, index: IndexDef, oldIndexName: string): string;
|
|
49
|
+
getDropIndexSQL(tableName: string, index: IndexDef): string;
|
|
49
50
|
private getIndexesSQL;
|
|
50
51
|
private getChecksSQL;
|
|
51
52
|
getChecks(connection: AbstractSqlConnection, tableName: string, schemaName: string, columns?: Column[]): Promise<CheckDef[]>;
|
|
@@ -501,6 +501,14 @@ class PostgreSqlSchemaHelper extends knex_1.SchemaHelper {
|
|
|
501
501
|
const keyName = this.platform.quoteIdentifier(index.keyName);
|
|
502
502
|
return `alter index ${oldIndexName} rename to ${keyName}`;
|
|
503
503
|
}
|
|
504
|
+
getDropIndexSQL(tableName, index) {
|
|
505
|
+
const [schemaName] = this.splitTableName(tableName);
|
|
506
|
+
const indexName = this.platform.quoteIdentifier(index.keyName);
|
|
507
|
+
if (schemaName && schemaName !== this.platform.getDefaultSchemaName()) {
|
|
508
|
+
return `drop index ${this.platform.quoteIdentifier(schemaName)}.${indexName}`;
|
|
509
|
+
}
|
|
510
|
+
return `drop index ${indexName}`;
|
|
511
|
+
}
|
|
504
512
|
getIndexesSQL(tables) {
|
|
505
513
|
return `select indrelid::regclass as table_name, ns.nspname as schema_name, relname as constraint_name, idx.indisunique as unique, idx.indisprimary as primary, contype, condeferrable, condeferred,
|
|
506
514
|
array(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/postgresql",
|
|
3
|
-
"version": "6.6.14-dev.
|
|
3
|
+
"version": "6.6.14-dev.3",
|
|
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.6.14-dev.
|
|
61
|
+
"@mikro-orm/knex": "6.6.14-dev.3",
|
|
62
62
|
"pg": "8.20.0",
|
|
63
63
|
"postgres-array": "3.0.4",
|
|
64
64
|
"postgres-date": "2.1.0",
|
|
@@ -68,6 +68,6 @@
|
|
|
68
68
|
"@mikro-orm/core": "^6.6.13"
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
71
|
-
"@mikro-orm/core": "6.6.14-dev.
|
|
71
|
+
"@mikro-orm/core": "6.6.14-dev.3"
|
|
72
72
|
}
|
|
73
73
|
}
|