38873-vm/db/migrations/14_ai_chats_table.sql
Flatlogic Bot d3e6f9d8d1 v30
2026-02-28 19:41:07 +00:00

10 lines
336 B
SQL

-- Migration: Create ai_chats table for AI assistant
CREATE TABLE IF NOT EXISTS ai_chats (
id INT AUTO_INCREMENT PRIMARY KEY,
user_id INT NULL,
user_message TEXT NOT NULL,
ai_response TEXT NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL
);