Created
June 18, 2015 22:21
-
-
Save willscripted/465b913daf5dc186600b to your computer and use it in GitHub Desktop.
autoupdate
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
CREATE OR REPLACE FUNCTION update_modified_column() | |
RETURNS TRIGGER AS $$ | |
BEGIN | |
NEW.updated_at = now(); | |
RETURN NEW; | |
END; | |
$$ language 'plpgsql'; | |
ALTER TABLE consumer_offsets ADD COLUMN updated_at timestamp default current_timestamp; | |
CREATE TRIGGER update_consumer_offsets_modtime BEFORE UPDATE ON consumer_offsets 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