-- +goose Up
ALTER TABLE users ADD COLUMN password_hash text;

CREATE TABLE sessions (
    id         uuid PRIMARY KEY,
    user_id    uuid NOT NULL REFERENCES users(id) ON DELETE CASCADE,
    token_hash text NOT NULL UNIQUE,
    expires_at timestamptz NOT NULL,
    created_at timestamptz NOT NULL DEFAULT now()
);
CREATE INDEX sessions_token_hash_idx ON sessions (token_hash);

-- +goose Down
DROP TABLE sessions;
ALTER TABLE users DROP COLUMN password_hash;
