feat: add conversation_tables migration
Add migration for conversation_tables to support dynamic per-user conversation storage. - CREATE TABLE conversation_tables with telegram_id, table_name, message_count - Add indexes on last_message_at and message_count for query performance - Tested successfully on local D1 database Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
14
migrations/008_conversation_tables.sql
Normal file
14
migrations/008_conversation_tables.sql
Normal file
@@ -0,0 +1,14 @@
|
||||
-- 대화 테이블 메타 정보
|
||||
-- 사용자별 동적 대화 테이블 관리
|
||||
|
||||
CREATE TABLE IF NOT EXISTS conversation_tables (
|
||||
telegram_id TEXT PRIMARY KEY,
|
||||
table_name TEXT NOT NULL,
|
||||
message_count INTEGER DEFAULT 0,
|
||||
last_message_at DATETIME,
|
||||
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
-- 인덱스
|
||||
CREATE INDEX IF NOT EXISTS idx_conv_tables_last_msg ON conversation_tables(last_message_at DESC);
|
||||
CREATE INDEX IF NOT EXISTS idx_conv_tables_count ON conversation_tables(message_count DESC);
|
||||
Reference in New Issue
Block a user