pluginever / wc-serial-numbers

The best WordPress Plugin to sell license keys, redeem cards and other secret numbers!
11 stars 12 forks source link

uuid database field field not populating for new serial numbers. #383

Open gmn42 opened 1 year ago

gmn42 commented 1 year ago

This may be low priority because it doesn't seem to be used for anything (yet), but I have noticed that the new uuid database field is not assigned a uuid for new serial numbers, although the update_156() routine took care to assign them for existing entries.

I was able to address it on the database side with: ALTER TABLE {$prefix}serial_numbers CHANGE uuid uuid DEFAULT (UUID()); UPDATE {$prefix}serial_numbers SET uuid = UUID() WHERE uuid IS NULL;

Note that default value function seems to require mysql >= 8.0.13 (2018), so I don't know if you want this dependency. See https://stackoverflow.com/questions/46134550/mysql-set-default-id-uuid for alternatives.