-
Notifications
You must be signed in to change notification settings - Fork 3
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 #1280 from cityofaustin/15489_replace_moped_proj_n…
…otes_rest_connector replace moped_proj_notes rest connectors with db triggers
- Loading branch information
Showing
13 changed files
with
69 additions
and
45 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
6 changes: 6 additions & 0 deletions
6
...ions/1708036428508_alter_table_public_moped_proj_notes_alter_column_date_created/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,6 @@ | ||
ALTER TABLE public.moped_proj_notes RENAME COLUMN created_at TO date_created; | ||
ALTER TABLE public.moped_proj_notes RENAME COLUMN created_by_user_id TO added_by_user_id; | ||
ALTER TABLE public.moped_proj_notes DROP COLUMN updated_at; | ||
ALTER TABLE public.moped_proj_notes DROP COLUMN updated_by_user_id; | ||
|
||
DROP TRIGGER update_moped_proj_notes_and_project_audit_fields ON moped_proj_notes; |
16 changes: 16 additions & 0 deletions
16
...ations/1708036428508_alter_table_public_moped_proj_notes_alter_column_date_created/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,16 @@ | ||
ALTER TABLE moped_proj_notes RENAME COLUMN date_created TO created_at; | ||
ALTER TABLE moped_proj_notes RENAME COLUMN added_by_user_id TO created_by_user_id; | ||
ALTER TABLE moped_proj_notes ADD COLUMN updated_at TIMESTAMPTZ | ||
NULL; | ||
ALTER TABLE moped_proj_notes ADD COLUMN updated_by_user_id INTEGER | ||
NULL; | ||
|
||
COMMENT ON COLUMN moped_proj_notes.updated_at IS 'Timestamp when the record was last updated'; | ||
COMMENT ON COLUMN moped_proj_notes.updated_by_user_id IS 'ID of the user who last updated the record'; | ||
|
||
CREATE TRIGGER update_moped_proj_notes_and_project_audit_fields | ||
BEFORE INSERT OR UPDATE ON moped_proj_notes | ||
FOR EACH ROW | ||
EXECUTE FUNCTION public.update_self_and_project_updated_audit_fields(); | ||
|
||
COMMENT ON TRIGGER update_moped_proj_notes_and_project_audit_fields ON moped_proj_notes IS 'Trigger to execute the update_self_and_project_updated_audit_fields function before each update operation on the moped_proj_notes table.'; |
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
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
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
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
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
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
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
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
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
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