orchid-orm 1.54.0 → 1.54.1
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/dist/migrations.js +5 -5
- package/dist/migrations.js.map +1 -1
- package/dist/migrations.mjs +5 -5
- package/dist/migrations.mjs.map +1 -1
- package/package.json +4 -4
package/dist/migrations.js
CHANGED
|
@@ -923,28 +923,28 @@ const changeEnum = (ast, dbEnum, codeEnum) => {
|
|
|
923
923
|
const { values: dbValues } = dbEnum;
|
|
924
924
|
const { values: codeValues, schema, name } = codeEnum;
|
|
925
925
|
if (dbValues.length < codeValues.length) {
|
|
926
|
-
if (!dbValues.some((value
|
|
926
|
+
if (!dbValues.some((value) => !codeValues.includes(value))) {
|
|
927
927
|
ast.push({
|
|
928
928
|
type: "enumValues",
|
|
929
929
|
action: "add",
|
|
930
930
|
schema,
|
|
931
931
|
name,
|
|
932
|
-
values: codeValues.
|
|
932
|
+
values: codeValues.filter((value) => !dbValues.includes(value))
|
|
933
933
|
});
|
|
934
934
|
return;
|
|
935
935
|
}
|
|
936
936
|
} else if (dbValues.length > codeValues.length) {
|
|
937
|
-
if (!codeValues.some((value
|
|
937
|
+
if (!codeValues.some((value) => !dbValues.includes(value))) {
|
|
938
938
|
ast.push({
|
|
939
939
|
type: "enumValues",
|
|
940
940
|
action: "drop",
|
|
941
941
|
schema,
|
|
942
942
|
name,
|
|
943
|
-
values: dbValues.
|
|
943
|
+
values: dbValues.filter((value) => !codeValues.includes(value))
|
|
944
944
|
});
|
|
945
945
|
return;
|
|
946
946
|
}
|
|
947
|
-
} else if (!dbValues.some((value
|
|
947
|
+
} else if (!dbValues.some((value) => !codeValues.includes(value))) {
|
|
948
948
|
return;
|
|
949
949
|
}
|
|
950
950
|
ast.push({
|