003_trigger copy.sql

1-- +goose up
2-- +goose StatementBegin
3
4-- auto update modified time
5CREATE TRIGGER IF NOT EXISTS adjust_mtime AFTER UPDATE ON documents
6    BEGIN
7        UPDATE documents SET mtime=datetime('now') WHERE id=old.id;
8    END;
9-- +goose StatementEnd