1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-18 19:40:55 +01:00

Fix Herald repetition policy migration for NULL

When we change a nullable column to a non-nullable column, we can get a
data truncation error if any value was "NULL".

This is exceptionally unusual, but our two very oldest Herald rules have
a "NULL" policy on `secure`.
This commit is contained in:
epriestley 2018-01-26 13:16:27 -08:00
parent 9d69118664
commit fd49acd033

View file

@ -5,6 +5,10 @@
*/
UPDATE {$NAMESPACE}_herald.herald_rule
SET repetitionPolicy = '1'
WHERE repetitionPolicy IS NULL;
ALTER TABLE {$NAMESPACE}_herald.herald_rule
CHANGE repetitionPolicy
repetitionPolicy VARCHAR(32) NOT NULL COLLATE {$COLLATE_TEXT};