CREATE TABLE IF NOT EXISTS user_email_change (
    token VARCHAR(255) PRIMARY KEY,
    user_uid UUID NOT NULL,
    new_email VARCHAR(255) NOT NULL,
    expires_at TIMESTAMPTZ NOT NULL,
    used BOOLEAN NOT NULL DEFAULT false,
    created_at TIMESTAMPTZ NOT NULL
);

CREATE INDEX idx_user_email_change_user_uid ON user_email_change (user_uid);
