-- Not yet deployed, do all in one migration.

CREATE TABLE signup_tokens(
    token TEXT NOT NULL,
    user_id uuid NOT NULL
        REFERENCES users (id),
    PRIMARY KEY (token)
);

ALTER TABLE users ADD COLUMN status TEXT NULL;

UPDATE users
    SET status = 'confirmed'
    where status IS NULL;

ALTER TABLE users ALTER COLUMN status SET NOT NULL;
