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
I already had an alt column I added years ago, so I think the recent migration was just ignored. The alt column is of type text and default is NULL (so yes, it's nullable). But any attempt to add a new record appears to fail because of a media.alt constraint at the DB level. I manually changed the alt column data type from LONGTEXT to TEXT which resolved the issue. I then manually set it back from TEXT to LONGTEXT and inserts still work.
I'm happy to provide any other information and also if no one else is affected, this might just be an issue with people who manually added the alt column previously, which is probably very small minority of users.
But also, I don't know if this worth examining, but I think that every insert is putting in an empty string value for the alt column, instead of null if there's no value set.
The text was updated successfully, but these errors were encountered:
Upon closer inspection, I initially created the alt field as a JSON column because I support translation of alt text using Spatie's Laravel-Translatable trait. This is why it breaks when trying to add a record with a blank string for the alt column when it should be NULL.
I still think that if the model's alt value is unset that inserting a blank string '' is not the correct behavior. If you agree I will see if I can help craft a PR to fix that.
I'm seeing the following type of MySQL error when creating new records:
I already had an
alt
column I added years ago, so I think the recent migration was just ignored. Thealt
column is of type text and default isNULL
(so yes, it's nullable). But any attempt to add a new record appears to fail because of amedia.alt
constraint at the DB level. I manually changed thealt
column data type fromLONGTEXT
toTEXT
which resolved the issue. I then manually set it back fromTEXT
toLONGTEXT
and inserts still work.I'm happy to provide any other information and also if no one else is affected, this might just be an issue with people who manually added the
alt
column previously, which is probably very small minority of users.But also, I don't know if this worth examining, but I think that every insert is putting in an empty string value for the
alt
column, instead ofnull
if there's no value set.The text was updated successfully, but these errors were encountered: