Prevent empty userfields (cause warnings in tables after deleting a file)

This commit is contained in:
Bernd Bestel 2020-08-31 19:54:31 +02:00
parent 844ec2ccae
commit 9b3106fb32
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300

16
migrations/0112.sql Normal file
View File

@ -0,0 +1,16 @@
DELETE FROM userfield_values
WHERE IFNULL(value, '') = '';
CREATE TRIGGER prevent_empty_userfields_INS AFTER INSERT ON userfield_values
BEGIN
DELETE FROM userfield_values
WHERE id = NEW.id
AND IFNULL(value, '') = '';
END;
CREATE TRIGGER prevent_empty_userfields_UPD2 AFTER UPDATE ON userfield_values
BEGIN
DELETE FROM userfield_values
WHERE id = NEW.id
AND IFNULL(value, '') = '';
END;