ALTER TABLE users ADD COLUMN confirmed_at TEXT;
UPDATE users SET confirmed_at = CURRENT_TIMESTAMP::text WHERE confirmed_at IS NULL;
CREATE TABLE account_confirmation_tokens (
 token TEXT PRIMARY KEY,
 user_id BIGINT NOT NULL REFERENCES users(id) ON DELETE CASCADE,
 expires_at TEXT NOT NULL,
 used_at TEXT,
 created_at TEXT NOT NULL DEFAULT (CURRENT_TIMESTAMP::text)
);
CREATE INDEX idx_account_confirmation_user ON account_confirmation_tokens(user_id);
