29 行
845 B
MySQL
29 行
845 B
MySQL
|
|
CREATE TABLE IF NOT EXISTS character_profiles (
|
||
|
|
profile_id TEXT PRIMARY KEY,
|
||
|
|
name TEXT NOT NULL,
|
||
|
|
description TEXT,
|
||
|
|
base_prompt TEXT,
|
||
|
|
appearance_prompt TEXT,
|
||
|
|
style_prompt TEXT,
|
||
|
|
negative_prompt TEXT,
|
||
|
|
default_model_route TEXT,
|
||
|
|
owner_platform TEXT NOT NULL,
|
||
|
|
owner_context_id TEXT,
|
||
|
|
owner_user_id TEXT NOT NULL,
|
||
|
|
owner_session_key TEXT,
|
||
|
|
avatar_image_uri TEXT,
|
||
|
|
status TEXT NOT NULL DEFAULT 'active',
|
||
|
|
metadata_json TEXT,
|
||
|
|
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||
|
|
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
||
|
|
);
|
||
|
|
|
||
|
|
CREATE INDEX IF NOT EXISTS idx_profiles_owner
|
||
|
|
ON character_profiles(owner_platform, owner_user_id);
|
||
|
|
|
||
|
|
CREATE INDEX IF NOT EXISTS idx_profiles_status
|
||
|
|
ON character_profiles(status);
|
||
|
|
|
||
|
|
CREATE INDEX IF NOT EXISTS idx_profiles_name
|
||
|
|
ON character_profiles(name);
|