-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1384 from cityofaustin/md-15509-update-metadata-t…
…rigger Update crash table unit metadata trigger to fire on any unit table row change
- Loading branch information
Showing
2 changed files
with
17 additions
and
0 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
atd-vzd/migrations/default/1708558749621_update_unit_metadata_trigger/down.sql
This file contains 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
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.'; |
8 changes: 8 additions & 0 deletions
8
atd-vzd/migrations/default/1708558749621_update_unit_metadata_trigger/up.sql
This file contains 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
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.'; |