--up

CREATE TABLE wavtool_standups (
    id integer GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
    user_id integer REFERENCES users (id) ON UPDATE RESTRICT ON DELETE CASCADE, -- user id if sync only affects one user
    date date NOT NULL,
    standup_done text,
    standup_doing text,
    standup_blockers text,
    standup_mood text,
    created_at timestamp NOT NULL DEFAULT now(),
    updated_at timestamp NOT NULL DEFAULT now()
);

CREATE TRIGGER set_timestamp
BEFORE UPDATE ON wavtool_standups FOR EACH ROW
EXECUTE PROCEDURE update_updated_at_column();

--down

DROP TABLE wavtool_standups;
