Skip to content

Commit

Permalink
Merge pull request #1384 from cityofaustin/md-15509-update-metadata-t…
Browse files Browse the repository at this point in the history
…rigger

Update crash table unit metadata trigger to fire on any unit table row change
  • Loading branch information
mddilley authored Feb 28, 2024
2 parents 4ef499d + fedf346 commit 42a39ff
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
DROP TRIGGER IF EXISTS atd_txdot_units_mode_category_metadata_update ON public.atd_txdot_units;

CREATE TRIGGER atd_txdot_units_mode_category_metadata_update
AFTER UPDATE ON public.atd_txdot_units
FOR EACH ROW
WHEN (old.atd_mode_category IS DISTINCT FROM new.atd_mode_category)
EXECUTE FUNCTION public.atd_txdot_units_mode_category_metadata_update();

COMMENT ON TRIGGER atd_txdot_units_mode_category_metadata_update ON public.atd_txdot_units IS 'Updates the associated crash table atd_mode_category_metadata column when a unit atd_mode_category is updated.';
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
DROP TRIGGER IF EXISTS atd_txdot_units_mode_category_metadata_update ON public.atd_txdot_units;

CREATE TRIGGER atd_txdot_units_mode_category_metadata_update
AFTER UPDATE ON public.atd_txdot_units
FOR EACH ROW
EXECUTE FUNCTION public.atd_txdot_units_mode_category_metadata_update();

COMMENT ON TRIGGER atd_txdot_units_mode_category_metadata_update ON public.atd_txdot_units IS 'Updates the associated crash table atd_mode_category_metadata column when a unit row is updated.';

0 comments on commit 42a39ff

Please sign in to comment.