feat: 初始化慧遇书院官网一期

This commit is contained in:
2026-08-12 18:01:17 +08:00
commit 5d31ee5743
101 changed files with 17259 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
CREATE TABLE IF NOT EXISTS media_assets (
id INTEGER PRIMARY KEY AUTOINCREMENT,
asset_key TEXT NOT NULL UNIQUE,
original_name TEXT NOT NULL,
mime_type TEXT NOT NULL,
extension TEXT NOT NULL,
bytes INTEGER NOT NULL,
width INTEGER NOT NULL,
height INTEGER NOT NULL,
original_path TEXT NOT NULL,
derived_path TEXT NOT NULL,
thumbnail_path TEXT NOT NULL,
alt_text TEXT NOT NULL DEFAULT '',
source_text TEXT NOT NULL DEFAULT '',
copyright_text TEXT NOT NULL DEFAULT '',
authorization_status TEXT NOT NULL DEFAULT 'pending' CHECK (authorization_status IN ('pending', 'authorized', 'restricted')),
status TEXT NOT NULL DEFAULT 'active' CHECK (status IN ('active', 'trash', 'deleted')),
created_by INTEGER,
created_at TEXT NOT NULL,
updated_at TEXT NOT NULL,
deleted_at TEXT,
FOREIGN KEY (created_by) REFERENCES admin_users(id)
);
CREATE INDEX IF NOT EXISTS idx_media_assets_status_created ON media_assets(status, created_at DESC);