- Remove empty creators from the database -- they shouldn't exist and were causing sync errors for some people
- Better logging for errors in metadata pane
This commit is contained in:
parent
f018e7d433
commit
3ca64f746a
4 changed files with 49 additions and 2 deletions
18
triggers.sql
18
triggers.sql
|
@ -1,4 +1,4 @@
|
|||
-- 9
|
||||
-- 10
|
||||
|
||||
-- Triggers to validate date field
|
||||
DROP TRIGGER IF EXISTS insert_date_field;
|
||||
|
@ -28,6 +28,22 @@ CREATE TRIGGER update_date_field BEFORE UPDATE ON itemData
|
|||
END;
|
||||
|
||||
|
||||
-- Don't allow empty creators
|
||||
DROP TRIGGER IF EXISTS insert_creatorData;
|
||||
CREATE TRIGGER insert_creatorData BEFORE INSERT ON creatorData
|
||||
FOR EACH ROW WHEN NEW.firstName='' AND NEW.lastName=''
|
||||
BEGIN
|
||||
SELECT RAISE (ABORT, 'Creator names cannot be empty');
|
||||
END;
|
||||
|
||||
DROP TRIGGER IF EXISTS update_creatorData;
|
||||
CREATE TRIGGER update_creatorData BEFORE UPDATE ON creatorData
|
||||
FOR EACH ROW WHEN NEW.firstName='' AND NEW.lastName=''
|
||||
BEGIN
|
||||
SELECT RAISE (ABORT, 'Creator names cannot be empty');
|
||||
END;
|
||||
|
||||
|
||||
--
|
||||
-- Fake foreign key constraint checks using triggers
|
||||
--
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue