feat: 初始化慧遇书院官网一期
This commit is contained in:
25
server/database/migrations/002_media_assets.sql
Normal file
25
server/database/migrations/002_media_assets.sql
Normal 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);
|
||||
Reference in New Issue
Block a user