@mikro-orm/knex 6.2.10-dev.95 → 6.2.10-dev.96
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/knex",
|
|
3
|
-
"version": "6.2.10-dev.
|
|
3
|
+
"version": "6.2.10-dev.96",
|
|
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.2.9"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
|
-
"@mikro-orm/core": "6.2.10-dev.
|
|
69
|
+
"@mikro-orm/core": "6.2.10-dev.96",
|
|
70
70
|
"better-sqlite3": "*",
|
|
71
71
|
"libsql": "*",
|
|
72
72
|
"mariadb": "*"
|
package/schema/SchemaHelper.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ export declare abstract class SchemaHelper {
|
|
|
21
21
|
getEnumDefinitions(connection: AbstractSqlConnection, checks: CheckDef[], tableName: string, schemaName?: string): Promise<Dictionary<string[]>>;
|
|
22
22
|
getCreateNativeEnumSQL(name: string, values: unknown[], schema?: string): string;
|
|
23
23
|
getDropNativeEnumSQL(name: string, schema?: string): string;
|
|
24
|
-
getAlterNativeEnumSQL(name: string, schema?: string, value?: string): string;
|
|
24
|
+
getAlterNativeEnumSQL(name: string, schema?: string, value?: string, items?: string[], oldItems?: string[]): string;
|
|
25
25
|
loadInformationSchema(schema: DatabaseSchema, connection: AbstractSqlConnection, tables: Table[], schemas?: string[]): Promise<void>;
|
|
26
26
|
getListTablesSQL(schemaName?: string): string;
|
|
27
27
|
getRenameColumnSQL(tableName: string, oldColumnName: string, to: Column, schemaName?: string): string;
|
package/schema/SchemaHelper.js
CHANGED
|
@@ -60,7 +60,7 @@ class SchemaHelper {
|
|
|
60
60
|
getDropNativeEnumSQL(name, schema) {
|
|
61
61
|
throw new Error('Not supported by given driver');
|
|
62
62
|
}
|
|
63
|
-
getAlterNativeEnumSQL(name, schema, value) {
|
|
63
|
+
getAlterNativeEnumSQL(name, schema, value, items, oldItems) {
|
|
64
64
|
throw new Error('Not supported by given driver');
|
|
65
65
|
}
|
|
66
66
|
async loadInformationSchema(schema, connection, tables, schemas) {
|
|
@@ -296,7 +296,7 @@ class SqlSchemaGenerator extends core_1.AbstractSchemaGenerator {
|
|
|
296
296
|
// postgres allows only adding new items, the values are case insensitive
|
|
297
297
|
itemsOld = itemsOld.map(v => v.toLowerCase());
|
|
298
298
|
const newItems = itemsNew.filter(val => !itemsOld.includes(val.toLowerCase()));
|
|
299
|
-
ret.push(...newItems.map(val => this.knex.schema.raw(this.helper.getAlterNativeEnumSQL(enumName, schemaName, val))));
|
|
299
|
+
ret.push(...newItems.map(val => this.knex.schema.raw(this.helper.getAlterNativeEnumSQL(enumName, schemaName, val, itemsNew, itemsOld))));
|
|
300
300
|
});
|
|
301
301
|
}
|
|
302
302
|
ret.push(this.helper.createSchemaBuilder(schemaName).alterTable(tableName, table => {
|