Closed Monica-Wood closed 1 year ago
This Migration worked without fail on system running branch dev/php8 with php version 7.4
It has to do with the database being updated rather than the version of PHP. The migration doesn't handle errors in some cases. I had added code for one case. I guess it's time to do the rest.
This is happening on the ca_entity_labels.checked which is a rather new field. Is there anything I can manually do to fix it up in the meantime?
Thanks.
Sorry, that's my migration, and yes, it's a bit unforgiving.
To get it to fix up in the meantime, you'll have to alter the entity labels table so that it looks like this: https://github.com/collectiveaccess/providence/blob/develop/install/inc/schema_mysql.sql#L2902-L2949
Why was the checked field ever set as a smallint with the default NULL in the first place? It was only added to the model 4 months ago.
I am thinking that if I update all checked that = NULL to 0, then run the migrate it should be ok?
I ran this on the DB
update ca_entity_labels set checked = 0 where checked is NULL;
then reran the migration and all went through correctly.
Just confirm that the values in there match that pattern first:
SELECT checked, count(*) FROM ca_entity_labels GROUP BY 1;
I just pushed a fix for this. It constrains values to 0 and 1 before attempting to update them, force anything NULL or not 1 to zero.
Thank you, have applied to our servers successfully.
I ran this on a couple of servers that were barfing on the original migration and both worked perfectly this time. So I am optimistic that we've sorted this out :-)
On system with dev/php8 and php version 8.1.13
After git pull I ran the update-database-schema and got this error