-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: first pass working trigger to merge into the suggested mileston…
…e table
- Loading branch information
1 parent
720d7d2
commit d05aa97
Showing
4 changed files
with
32 additions
and
6 deletions.
There are no files selected for viewing
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
14 changes: 14 additions & 0 deletions
14
migrations/V196__Add_MTO_Suggested_Milestone_Trigger_To_Table.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,14 @@ | ||
CREATE FUNCTION public.ADD_MTO_SUGGESTED_MILESTONE_SUGGESTION_TRIGGER(schema_name TEXT, table_name TEXT) RETURNS VOID AS $body$DECLARE | ||
_q_txt TEXT; | ||
BEGIN | ||
EXECUTE 'DROP TRIGGER IF EXISTS mto_suggested_milestone_trigger ON ' || schema_name || '.' || table_name; | ||
_q_txt = 'CREATE TRIGGER mto_suggested_milestone_trigger AFTER UPDATE ON ' || | ||
schema_name || '.' || table_name || | ||
' FOR EACH ROW EXECUTE PROCEDURE public.SET_SUGGESTED_MTO_MILESTONE();'; | ||
|
||
RAISE NOTICE '%',_q_txt; | ||
EXECUTE _q_txt; | ||
|
||
|
||
END | ||
$body$ LANGUAGE plpgsql; |
11 changes: 11 additions & 0 deletions
11
migrations/V197__Add_MTO_Suggested_Milestone_Triggers_To_Task_List.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,11 @@ | ||
-- SELECT public.ADD_MTO_SUGGESTED_MILESTONE_SUGGESTION_TRIGGER('public', 'plan_basics'); -- no records currently are based on basics | ||
|
||
SELECT public.ADD_MTO_SUGGESTED_MILESTONE_SUGGESTION_TRIGGER('public', 'plan_beneficiaries'); | ||
|
||
SELECT public.ADD_MTO_SUGGESTED_MILESTONE_SUGGESTION_TRIGGER('public', 'plan_general_characteristics'); | ||
|
||
SELECT public.ADD_MTO_SUGGESTED_MILESTONE_SUGGESTION_TRIGGER('public', 'plan_ops_eval_and_learning'); | ||
|
||
SELECT public.ADD_MTO_SUGGESTED_MILESTONE_SUGGESTION_TRIGGER('public', 'plan_participants_and_providers'); | ||
|
||
SELECT public.ADD_MTO_SUGGESTED_MILESTONE_SUGGESTION_TRIGGER('public', 'plan_payments'); |
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