Created
March 25, 2019 12:01
-
-
Save martimatix/d0d8501129d563e22eccf35a0f3f4069 to your computer and use it in GitHub Desktop.
Hasura Gists
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 will automatically update the `updated_at` column on the table `category` | |
CREATE OR REPLACE FUNCTION update_modified_column() | |
RETURNS TRIGGER AS $$ | |
BEGIN | |
NEW.updated_at = now(); | |
RETURN NEW; | |
END; | |
$$ language 'plpgsql'; | |
CREATE TRIGGER update_category_updated_at BEFORE UPDATE ON category FOR EACH ROW EXECUTE PROCEDURE update_modified_column(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment