CREATE TABLE account_action_tokens (
 token TEXT PRIMARY KEY,
 user_id BIGINT NOT NULL REFERENCES users(id) ON DELETE CASCADE,
 action TEXT NOT NULL,
 payload TEXT,
 expires_at TEXT NOT NULL,
 used_at TEXT,
 created_at TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE INDEX idx_account_action_user ON account_action_tokens(user_id);
