Why does my row's status stay unchanged with no error when I write a new status value? #30
Answered
by
Kevinchamplin
Kevinchamplin
asked this question in
Q&A
-
|
Why does my row's status stay unchanged with no error when I write a new status value? |
Beta Was this translation helpful? Give feedback.
Answered by
Kevinchamplin
Jun 13, 2026
Replies: 1 comment
-
|
Writing a value that isn't in an ENUM(...) set, outside MySQL strict mode, emits a silent warning 1265 'Data truncated' and writes an empty string rather than erroring — so the row keeps its old/blank status and the bug hides downstream. Grep the migration's enum() before introducing any new status string; a genuinely new value needs an ALTER TABLE first. Run strict mode so truncation throws. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Kevinchamplin
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Writing a value that isn't in an ENUM(...) set, outside MySQL strict mode, emits a silent warning 1265 'Data truncated' and writes an empty string rather than erroring — so the row keeps its old/blank status and the bug hides downstream. Grep the migration's enum() before introducing any new status string; a genuinely new value needs an ALTER TABLE first. Run strict mode so truncation throws.