@mikro-orm/postgresql 6.6.17-dev.2 → 6.6.17-dev.4
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.js
CHANGED
|
@@ -124,6 +124,10 @@ class PostgreSqlPlatform extends knex_1.AbstractSqlPlatform {
|
|
|
124
124
|
if (['interval'].includes(simpleType)) {
|
|
125
125
|
return this.getIntervalTypeDeclarationSQL(options);
|
|
126
126
|
}
|
|
127
|
+
// PostGIS reports modifiers without spaces, unlike user-supplied declarations.
|
|
128
|
+
if (['geometry', 'geography'].includes(simpleType)) {
|
|
129
|
+
return type.toLowerCase().replace(/\s+/g, '');
|
|
130
|
+
}
|
|
127
131
|
// TimeType.getColumnType drops the timezone qualifier, so detect tz aliases from the original column type.
|
|
128
132
|
const originalType = options.columnTypes?.[0]?.toLowerCase() ?? type;
|
|
129
133
|
if (/^timetz\b/.test(originalType) || /^time\s+with\s+time\s+zone\b/.test(originalType)) {
|
|
@@ -112,6 +112,7 @@ class PostgreSqlSchemaHelper extends knex_1.SchemaHelper {
|
|
|
112
112
|
is_nullable,
|
|
113
113
|
udt_name,
|
|
114
114
|
udt_schema,
|
|
115
|
+
pg_catalog.format_type(pga.atttypid, pga.atttypmod) format_type,
|
|
115
116
|
coalesce(datetime_precision, character_maximum_length) length,
|
|
116
117
|
atttypmod custom_length,
|
|
117
118
|
numeric_precision,
|
|
@@ -143,6 +144,10 @@ class PostgreSqlSchemaHelper extends knex_1.SchemaHelper {
|
|
|
143
144
|
if (type === 'bpchar') {
|
|
144
145
|
type = 'char';
|
|
145
146
|
}
|
|
147
|
+
// PostGIS stores spatial type modifiers in atttypmod, outside information_schema.
|
|
148
|
+
if ((col.udt_name === 'geometry' || col.udt_name === 'geography') && col.format_type) {
|
|
149
|
+
type = col.format_type;
|
|
150
|
+
}
|
|
146
151
|
if (type === 'vector' && col.length == null && col.custom_length != null && col.custom_length !== -1) {
|
|
147
152
|
col.length = col.custom_length;
|
|
148
153
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/postgresql",
|
|
3
|
-
"version": "6.6.17-dev.
|
|
3
|
+
"version": "6.6.17-dev.4",
|
|
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.17-dev.
|
|
61
|
+
"@mikro-orm/knex": "6.6.17-dev.4",
|
|
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.16"
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
71
|
-
"@mikro-orm/core": "6.6.17-dev.
|
|
71
|
+
"@mikro-orm/core": "6.6.17-dev.4"
|
|
72
72
|
}
|
|
73
73
|
}
|