summaryrefslogtreecommitdiff
path: root/deploy/update_timestamp.sql
blob: 7bcec3cf37e6aa8d541bef9e5fe2850e73e12ab0 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
-- Deploy photos:update_timestamp to pg
-- requires: schema

BEGIN;

SET search_path to photos;

CREATE OR REPLACE FUNCTION update_timestamp() RETURNS TRIGGER AS $$
  BEGIN
    NEW.updated_at = NOW();
    RETURN NEW;
  END;
$$ LANGUAGE plpgsql;

COMMIT;