- 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:
Dan Stillman 2009-05-18 10:15:19 +00:00
parent f018e7d433
commit 3ca64f746a
4 changed files with 49 additions and 2 deletions

View file

@ -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
--