From f3596fb5095737e666b97438b9d1873a99cd23f1 Mon Sep 17 00:00:00 2001 From: kappa Date: Thu, 5 Feb 2026 09:21:16 +0900 Subject: [PATCH] chore: add domain/deposit agent session tables migration Co-Authored-By: Claude Opus 4.5 --- migrations/006_add_agent_sessions.sql | 32 +++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 migrations/006_add_agent_sessions.sql diff --git a/migrations/006_add_agent_sessions.sql b/migrations/006_add_agent_sessions.sql new file mode 100644 index 0000000..cc5d8fe --- /dev/null +++ b/migrations/006_add_agent_sessions.sql @@ -0,0 +1,32 @@ +-- Migration 006: Add domain and deposit agent session tables +-- Date: 2026-02-05 +-- Description: Add domain_sessions and deposit_sessions tables for multi-turn agent conversations + +-- Domain agent sessions table +CREATE TABLE IF NOT EXISTS domain_sessions ( + user_id TEXT PRIMARY KEY, + status TEXT NOT NULL CHECK(status IN ('gathering', 'suggesting', 'confirming', 'setting_ns', 'completed')), + collected_info TEXT, + target_domain TEXT, + messages TEXT, + created_at INTEGER NOT NULL, + updated_at INTEGER NOT NULL, + expires_at INTEGER NOT NULL +); + +-- Deposit agent sessions table +CREATE TABLE IF NOT EXISTS deposit_sessions ( + user_id TEXT PRIMARY KEY, + status TEXT NOT NULL CHECK(status IN ('collecting_amount', 'collecting_name', 'confirming', 'completed')), + collected_info TEXT, + messages TEXT, + created_at INTEGER NOT NULL, + updated_at INTEGER NOT NULL, + expires_at INTEGER NOT NULL +); + +-- Create index for expiry cleanup (domain_sessions) +CREATE INDEX IF NOT EXISTS idx_domain_sessions_expires ON domain_sessions(expires_at); + +-- Create index for expiry cleanup (deposit_sessions) +CREATE INDEX IF NOT EXISTS idx_deposit_sessions_expires ON deposit_sessions(expires_at);