[feat] add initial database schema with tables, triggers, and views

This commit is contained in:
2025-08-21 00:22:03 +02:00
parent 31af27f515
commit b8f33e252a
68 changed files with 882 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
CREATE TRIGGER trg_requirement_check_exclgrp_update
BEFORE UPDATE ON requirement
WHEN NEW.req_type='EXCLUSIVE_GROUP'
BEGIN
SELECT CASE
WHEN NEW.req_id IS NULL OR NOT EXISTS (SELECT 1 FROM exclusive_group WHERE id=NEW.req_id)
THEN RAISE(ABORT,'requirement.req_id must reference exclusive_group.id for EXCLUSIVE_GROUP (UPDATE)')
END;
END;