chore: add server provisioning migrations
- 003_add_server_tables.sql: server_orders, server_instances tables - 003_server_sessions.sql: KV-based session tracking - 004_add_terminated_at.sql: track instance termination time Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
17
migrations/003_server_sessions.sql
Normal file
17
migrations/003_server_sessions.sql
Normal file
@@ -0,0 +1,17 @@
|
||||
-- Server consultation sessions table
|
||||
CREATE TABLE IF NOT EXISTS server_sessions (
|
||||
user_id TEXT PRIMARY KEY,
|
||||
status TEXT NOT NULL DEFAULT 'gathering',
|
||||
collected_info TEXT, -- JSON
|
||||
last_recommendation TEXT, -- JSON
|
||||
messages TEXT, -- JSON
|
||||
created_at INTEGER NOT NULL,
|
||||
updated_at INTEGER NOT NULL,
|
||||
expires_at INTEGER NOT NULL
|
||||
);
|
||||
|
||||
-- Index for cleanup job
|
||||
CREATE INDEX IF NOT EXISTS idx_sessions_expires ON server_sessions(expires_at);
|
||||
|
||||
-- Index for status queries
|
||||
CREATE INDEX IF NOT EXISTS idx_sessions_status ON server_sessions(user_id, status);
|
||||
Reference in New Issue
Block a user