refactor: Business logic and dependencies updates
- 核心服务代码更新 (db, server, auth, proxy) - Agent 相关模块更新 (mindspace, experience) - 前端组件和 hooks 更新 - 数据库 schema 更新 - 依赖版本更新
This commit is contained in:
+34
@@ -223,6 +223,7 @@ CREATE TABLE IF NOT EXISTS h5_publish_records (
|
||||
token_hash CHAR(64) NULL,
|
||||
token_prefix VARCHAR(16) NULL,
|
||||
expires_at BIGINT NULL,
|
||||
user_confirmed_at BIGINT NULL,
|
||||
published_at BIGINT NOT NULL,
|
||||
offline_at BIGINT NULL,
|
||||
status ENUM('draft', 'online', 'expired', 'offline', 'blocked') NOT NULL DEFAULT 'online',
|
||||
@@ -232,6 +233,7 @@ CREATE TABLE IF NOT EXISTS h5_publish_records (
|
||||
updated_at BIGINT NOT NULL,
|
||||
KEY idx_h5_publish_route (url_slug, status, published_at),
|
||||
KEY idx_h5_publish_page (user_id, page_id, published_at),
|
||||
KEY idx_h5_publish_auto_private (expires_at, user_confirmed_at) WHERE access_mode = 'public' AND user_confirmed_at IS NULL,
|
||||
UNIQUE KEY uq_h5_publish_token_hash (token_hash),
|
||||
CONSTRAINT fk_h5_publish_user FOREIGN KEY (user_id) REFERENCES h5_users(id) ON DELETE CASCADE,
|
||||
CONSTRAINT fk_h5_publish_page FOREIGN KEY (page_id) REFERENCES h5_page_records(id) ON DELETE CASCADE,
|
||||
@@ -239,6 +241,17 @@ CREATE TABLE IF NOT EXISTS h5_publish_records (
|
||||
CONSTRAINT fk_h5_publish_scan FOREIGN KEY (security_scan_id) REFERENCES h5_security_scans(id) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS h5_publication_asset_refs (
|
||||
publication_id CHAR(36) NOT NULL,
|
||||
asset_id CHAR(36) NOT NULL,
|
||||
created_at BIGINT NOT NULL,
|
||||
PRIMARY KEY (publication_id, asset_id),
|
||||
KEY idx_asset_id (asset_id),
|
||||
KEY idx_created_at (created_at),
|
||||
CONSTRAINT fk_h5_pub_asset_ref_pub FOREIGN KEY (publication_id) REFERENCES h5_publish_records(id) ON DELETE CASCADE,
|
||||
CONSTRAINT fk_h5_pub_asset_ref_asset FOREIGN KEY (asset_id) REFERENCES h5_assets(id) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS h5_publication_events (
|
||||
id CHAR(36) PRIMARY KEY,
|
||||
publish_id CHAR(36) NOT NULL,
|
||||
@@ -997,3 +1010,24 @@ CREATE TABLE IF NOT EXISTS h5_blocked_words (
|
||||
updated_at BIGINT NOT NULL,
|
||||
UNIQUE KEY uk_blocked_word (word)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
-- Shared experience store (etat C): all goosed Worker instances read/write the
|
||||
-- same learned experience so capability is not siloed per instance. Built on
|
||||
-- MySQL first with a keyword + recency retrieval; `embedding` is reserved for a
|
||||
-- later move to PostgreSQL + pgvector without changing the calling contract.
|
||||
CREATE TABLE IF NOT EXISTS h5_experience (
|
||||
id CHAR(36) PRIMARY KEY,
|
||||
scope VARCHAR(64) NOT NULL DEFAULT 'global',
|
||||
kind VARCHAR(32) NOT NULL DEFAULT 'lesson',
|
||||
title VARCHAR(255) NOT NULL,
|
||||
body MEDIUMTEXT NOT NULL,
|
||||
tags_json JSON NULL,
|
||||
source_session_id VARCHAR(128) NULL,
|
||||
source_user_id CHAR(36) NULL,
|
||||
use_count BIGINT NOT NULL DEFAULT 0,
|
||||
embedding JSON NULL,
|
||||
created_at BIGINT NOT NULL,
|
||||
updated_at BIGINT NOT NULL,
|
||||
KEY idx_h5_experience_scope_updated (scope, updated_at),
|
||||
FULLTEXT KEY ftx_h5_experience (title, body)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
Reference in New Issue
Block a user