10 lines
355 B
PL/PgSQL
10 lines
355 B
PL/PgSQL
CREATE OR REPLACE FUNCTION update_updated_at_column()
|
|
RETURNS TRIGGER AS $$
|
|
BEGIN
|
|
NEW.updated_at = now();
|
|
RETURN NEW;
|
|
END;
|
|
$$ language plpgsql;
|
|
|
|
DROP trigger if exists update_objects_updated_at on storage.objects;
|
|
CREATE TRIGGER update_objects_updated_at BEFORE UPDATE ON storage.objects FOR EACH ROW EXECUTE PROCEDURE update_updated_at_column(); |