This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- DROP FUNCTION public.archive_requirements_history(); | |
| CREATE OR REPLACE FUNCTION public.archive_requirements_history() | |
| RETURNS trigger | |
| LANGUAGE plpgsql | |
| AS $function$ | |
| BEGIN | |
| -- Archive old row to history only if version has changed | |
| IF OLD.version <> NEW.version THEN | |
| INSERT INTO public.requirements_history ( |