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
{{ message }}
Repository navigation
Bug: unknown column-type / onDelete tokens silently fall back to Text / NoAction (no validation) — typos corrupt the schema #71
Unrecognized type: and onDelete: tokens in a schema YAML are silently coerced to Text / NoAction with no error or warning. A typo therefore produces a silently-wrong schema that still "migrates successfully" and passes the post-apply integrity check (because both the desired and actual sides agree on the wrong type).
Environment
v0.9.12-beta (commit 8e3af36)
Details
In Migration/Nimblesite.DataProvider.Migration.Core/SchemaYamlSerializer.cs:
ParseType(...) ends both the parameterized and the simple switch with _ => new TextType() (≈ lines 221 and 249).
ForeignKeyActionYamlConverter.ReadYaml(...) ends with _ => ForeignKeyAction.NoAction (≈ line 302).
Repro
- { name: id, type: Uuidd, isNullable: false } # typo -> column created as TEXT, no errorforeignKeys:
- { columns: [parent_id], referencedTable: t, referencedColumns: [id], onDelete: Cascadee } # typo -> NO ACTION
migrate reports success and the integrity check passes, but id is text (not uuid) and the FK is NO ACTION (not CASCADE).
Impact
Silent schema corruption from a single-character typo: a uuid/json/timestamptz column quietly becomes text; a cascade/set-null FK quietly becomes no-action. The "integrity check passed" message gives false confidence.
Suggested fix
Reject an unrecognized token (return a MigrationError / throw a parse error), or at minimum emit a loud warn log naming the offending token and column. Defaulting to Text/NoAction should never be silent.
Activity