update: 表改动 主页改动
Some checks failed
CI / verify (push) Has been cancelled

This commit is contained in:
victo
2026-04-14 18:58:33 +08:00
parent 0981d6ee1b
commit 3d6f31433a
37 changed files with 2594 additions and 699 deletions

View File

@@ -0,0 +1,24 @@
CREATE TABLE IF NOT EXISTS custom_world_profiles (
user_id TEXT NOT NULL,
profile_id TEXT NOT NULL,
payload_json JSONB NOT NULL,
visibility TEXT NOT NULL DEFAULT 'draft',
published_at TEXT,
author_display_name TEXT NOT NULL DEFAULT '玩家',
world_name TEXT NOT NULL DEFAULT '',
subtitle TEXT NOT NULL DEFAULT '',
summary_text TEXT NOT NULL DEFAULT '',
cover_image_src TEXT,
theme_mode TEXT NOT NULL DEFAULT 'mythic',
playable_npc_count INTEGER NOT NULL DEFAULT 0,
landmark_count INTEGER NOT NULL DEFAULT 0,
updated_at TEXT NOT NULL,
PRIMARY KEY (user_id, profile_id),
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE
);
CREATE INDEX IF NOT EXISTS custom_world_profiles_user_updated_idx
ON custom_world_profiles (user_id, updated_at DESC);
CREATE INDEX IF NOT EXISTS custom_world_profiles_published_idx
ON custom_world_profiles (visibility, published_at DESC, updated_at DESC);