@mikro-orm/postgresql 6.2.10-dev.95 → 6.2.10-dev.97
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.
|
@@ -31,7 +31,7 @@ export declare class PostgreSqlSchemaHelper extends SchemaHelper {
|
|
|
31
31
|
}>>;
|
|
32
32
|
getCreateNativeEnumSQL(name: string, values: unknown[], schema?: string): string;
|
|
33
33
|
getDropNativeEnumSQL(name: string, schema?: string): string;
|
|
34
|
-
getAlterNativeEnumSQL(name: string, schema?: string, value?: string): string;
|
|
34
|
+
getAlterNativeEnumSQL(name: string, schema?: string, value?: string, items?: string[], oldItems?: string[]): string;
|
|
35
35
|
getEnumDefinitions(connection: AbstractSqlConnection, checks: CheckDef[], tableName?: string, schemaName?: string): Promise<Dictionary<string[]>>;
|
|
36
36
|
createTableColumn(table: Knex.TableBuilder, column: Column, fromTable: DatabaseTable, changedProperties?: Set<string>, alter?: boolean): Knex.ColumnBuilder | undefined;
|
|
37
37
|
configureColumn(column: Column, col: Knex.ColumnBuilder, knex: Knex, changedProperties?: Set<string>): Knex.ColumnBuilder;
|
|
@@ -261,11 +261,21 @@ class PostgreSqlSchemaHelper extends knex_1.SchemaHelper {
|
|
|
261
261
|
}
|
|
262
262
|
return `drop type ${this.platform.quoteIdentifier(name)}`;
|
|
263
263
|
}
|
|
264
|
-
getAlterNativeEnumSQL(name, schema, value) {
|
|
264
|
+
getAlterNativeEnumSQL(name, schema, value, items, oldItems) {
|
|
265
265
|
if (schema && schema !== this.platform.getDefaultSchemaName()) {
|
|
266
266
|
name = schema + '.' + name;
|
|
267
267
|
}
|
|
268
|
-
|
|
268
|
+
let suffix = '';
|
|
269
|
+
if (items && value && oldItems) {
|
|
270
|
+
const position = items.indexOf(value);
|
|
271
|
+
if (position > 0) {
|
|
272
|
+
suffix = ` after ${this.platform.quoteValue(items[position - 1])}`;
|
|
273
|
+
}
|
|
274
|
+
else if (items.length > 1 && oldItems.includes(items[1])) {
|
|
275
|
+
suffix = ` before ${this.platform.quoteValue(items[1])}`;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
return `alter type ${this.platform.quoteIdentifier(name)} add value if not exists ${this.platform.quoteValue(value)}${suffix}`;
|
|
269
279
|
}
|
|
270
280
|
async getEnumDefinitions(connection, checks, tableName, schemaName) {
|
|
271
281
|
const found = [];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/postgresql",
|
|
3
|
-
"version": "6.2.10-dev.
|
|
3
|
+
"version": "6.2.10-dev.97",
|
|
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.2.10-dev.
|
|
61
|
+
"@mikro-orm/knex": "6.2.10-dev.97",
|
|
62
62
|
"pg": "8.12.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.2.9"
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
71
|
-
"@mikro-orm/core": "6.2.10-dev.
|
|
71
|
+
"@mikro-orm/core": "6.2.10-dev.97"
|
|
72
72
|
}
|
|
73
73
|
}
|