chore: update book enabled status wiring

This commit is contained in:
2026-04-27 11:41:35 +08:00
parent 93bde0a6b6
commit 67c33d06be
25 changed files with 336 additions and 122 deletions

View File

@@ -7,7 +7,6 @@
-- 模型model/book/book_author.go
-- 迁移接入initialize/gorm_biz.go
-- 删除策略硬删表
-- 启用状态字典common_enabled_status
-- 职责承载书籍作者主体信息用于作者资料展示书籍作者关联和后台作者管理
CREATE TABLE book_author (
@@ -15,7 +14,7 @@ CREATE TABLE book_author (
created_at timestamp with time zone NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at timestamp with time zone NOT NULL DEFAULT CURRENT_TIMESTAMP,
name varchar(128) NOT NULL,
author_status varchar(32) NOT NULL DEFAULT 'enabled',
is_enabled boolean NOT NULL DEFAULT true,
intro text,
cover_url varchar(500)
);
@@ -25,10 +24,10 @@ COMMENT ON COLUMN book_author.id IS '主键';
COMMENT ON COLUMN book_author.created_at IS '创建时间';
COMMENT ON COLUMN book_author.updated_at IS '更新时间';
COMMENT ON COLUMN book_author.name IS '作者名称';
COMMENT ON COLUMN book_author.author_status IS '作者启用状态字典值对应 common_enabled_status';
COMMENT ON COLUMN book_author.is_enabled IS '作者是否启用';
COMMENT ON COLUMN book_author.intro IS '作者简介';
COMMENT ON COLUMN book_author.cover_url IS '作者封面图片 URL';
CREATE UNIQUE INDEX uk_book_author_name ON book_author (name);
CREATE INDEX idx_book_author_author_status ON book_author (author_status);
CREATE INDEX idx_book_author_is_enabled ON book_author (is_enabled);
CREATE INDEX idx_book_author_created_at ON book_author (created_at);