fix: Drop invalid SetNull and SetDefault test models (#165)

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Marcelo Mendonça Soares <marcelomendoncasoares@users.noreply.github.com>
This commit is contained in:
Marcelo Mendonça Soares 2026-10-08 18:21:10 -03:00 • committed by GitHub
commit e12c9dc9f0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -540,13 +540,11 @@ class CrdtForeignKeyProjector {
switch (edge.action) {
case ForeignKeyAction.setNull:
if (edge.childNullable) {
safeData[edge.childColumn] = null;
attempts[fieldKey] = (
value: attemptedValue,
reason: CrdtProjectionReason.foreignKeySetNull,
);
}
safeData[edge.childColumn] = null;
attempts[fieldKey] = (
value: attemptedValue,
reason: CrdtProjectionReason.foreignKeySetNull,
);
case ForeignKeyAction.setDefault:
final defaultProjection = await _defaultProjectionValueFromDatabase(
edge,
@ -1808,7 +1806,7 @@ class CrdtForeignKeyProjector {
) {
switch (edge.action) {
case ForeignKeyAction.setNull:
return edge.childNullable;
return true;
case ForeignKeyAction.setDefault:
final defaultValue = edge.defaultValue.toUuidValue();
if (defaultValue == null) return edge.childNullable;
@ -1893,7 +1891,7 @@ class CrdtForeignKeyProjector {
case ForeignKeyAction.noAction:
return true;
case ForeignKeyAction.setNull:
if (!edge.childNullable) return true;
break;
case ForeignKeyAction.setDefault:
if (!_defaultProjectionValue(edge, state, finalHidden).valid) {
return true;
@ -2124,10 +2122,8 @@ class CrdtForeignKeyProjector {
_targetHiddenOrMissing(edge, attemptedValue, state, finalHidden)) {
switch (edge.action) {
case ForeignKeyAction.setNull:
if (edge.childNullable) {
desiredVisibleValue = null;
overrideReason = CrdtProjectionReason.foreignKeySetNull;
}
desiredVisibleValue = null;
overrideReason = CrdtProjectionReason.foreignKeySetNull;
case ForeignKeyAction.setDefault:
final defaultProjection = _defaultProjectionValue(
edge,