-
Notifications
You must be signed in to change notification settings - Fork 32
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Using a unique constraint on a "GENERATED ALWAYS AS ( generation_expr ) STORED" - column, gives you:
Error: Unique constraint "_the_key" violated for
model "model" on fields (_field) with values ().
This is because
const values = constraint.fields.map((c) => props.modelData[c]);
is [ undefined ], in this case.
Suggested fix by doing this update to constraints.ts:
before:
for (const constraint of sortedConstraints) {
// We skip the constraint if it contains null values
if (
constraint.fields.some((c) => props.modelData[c] === null)
after:
for (const constraint of sortedConstraints) {
// We skip the constraint if it contains null values
if (
constraint.fields.some((c) => props.modelData[c] === null || props.modelData[c] === undefined)
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working