You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)
The text was updated successfully, but these errors were encountered:
Using a unique constraint on a "GENERATED ALWAYS AS ( generation_expr ) STORED" - column, gives you:
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:
after:
The text was updated successfully, but these errors were encountered: