What DB I am using?
What do I need?
.update({ name: 'Middle Earth' }) method I need to
automatically update also a timestamp in my table.create extension if not exists moddatetime schema extensions;
-- assuming the table name is "todos", and a timestamp column "updated_at"
-- this trigger will set the "updated_at" column to the current timestamp for every update
create trigger handle_updated_at before update on todos
for each row execute procedure moddatetime (updated_at);
moddatetime extension?This stackoverflow question will give you an answer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With