fix(education): validate content node migration

This commit is contained in:
2026-07-30 23:57:07 +08:00
parent f84aecf8f5
commit 2daeb43c5a
2 changed files with 18 additions and 7 deletions

View File

@@ -81,8 +81,7 @@ BEGIN
NEW.name IS DISTINCT FROM OLD.name OR NEW.title IS DISTINCT FROM OLD.title OR
NEW.node_type IS DISTINCT FROM OLD.node_type OR NEW.marker_type IS DISTINCT FROM OLD.marker_type OR
NEW.is_leaf IS DISTINCT FROM OLD.is_leaf OR NEW.is_selectable IS DISTINCT FROM OLD.is_selectable OR
NEW.is_hidden IS DISTINCT FROM OLD.is_hidden OR NEW.sort_order IS DISTINCT FROM OLD.sort_order OR
NEW.metadata IS DISTINCT FROM OLD.metadata) THEN
NEW.sort_order IS DISTINCT FROM OLD.sort_order OR NEW.metadata IS DISTINCT FROM OLD.metadata) THEN
RAISE EXCEPTION 'active content node content is immutable' USING ERRCODE = '23514';
END IF;
RETURN NEW;