terraware
Database
Tables
(current)
Columns
Constraints
Relationships
Orphan Tables
Anomalies
Routines
reject_update_value
Parameters
Name
Type
Mode
Definition
BEGIN IF (OLD.created_by != -1 AND NEW.created_by = -1 AND NOT EXISTS (SELECT 1 FROM users WHERE id = OLD.created_by)) OR (OLD.verified_by != -1 AND NEW.verified_by = -1 AND NOT EXISTS (SELECT 1 FROM users WHERE id = OLD.verified_by)) THEN RAISE 'This table does not allow updates.'; ELSE -- This is an update triggered by a user being deleted. RETURN NEW; END IF; END;