Skip to content

Commit

Permalink
Added trigger to update "updated_at" timestamp on sites_cultivars rows.
Browse files Browse the repository at this point in the history
  • Loading branch information
gsrohde committed May 15, 2017
1 parent 4be7c6b commit 523d4be
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions db/migrate/20170415183619_add_sites_cultivars.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ def up
updated_at timestamp(6) without time zone DEFAULT utc_now()
);

CREATE TRIGGER update_sites_cultivars_timestamp
BEFORE UPDATE ON sites_cultivars
FOR EACH ROW
EXECUTE PROCEDURE update_timestamp();


CREATE OR REPLACE FUNCTION check_correct_cultivar()
RETURNS TRIGGER AS $body$
DECLARE
Expand Down

0 comments on commit 523d4be

Please sign in to comment.