mirror of
https://github.com/grocy/grocy.git
synced 2026-04-06 21:06:15 +02:00
Prevent empty userfields (cause warnings in tables after deleting a file)
This commit is contained in:
parent
844ec2ccae
commit
9b3106fb32
16
migrations/0112.sql
Normal file
16
migrations/0112.sql
Normal 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;
|
||||
Loading…
Reference in New Issue
Block a user