服务端
Some checks failed
CI / init (push) Has been cancelled
CI / Frontend node 18.16.0 (push) Has been cancelled
CI / Backend go (1.22) (push) Has been cancelled
CI / devops-test (1.22, 18.16.0) (push) Has been cancelled
CI / release-pr (push) Has been cancelled
CI / release-please (push) Has been cancelled
CI / devops-prod (1.22, 18.x) (push) Has been cancelled
CI / docker (push) Has been cancelled
Some checks failed
CI / init (push) Has been cancelled
CI / Frontend node 18.16.0 (push) Has been cancelled
CI / Backend go (1.22) (push) Has been cancelled
CI / devops-test (1.22, 18.16.0) (push) Has been cancelled
CI / release-pr (push) Has been cancelled
CI / release-please (push) Has been cancelled
CI / devops-prod (1.22, 18.x) (push) Has been cancelled
CI / docker (push) Has been cancelled
This commit is contained in:
39
server/.ai-specs/doc-sql/book_author.md
Normal file
39
server/.ai-specs/doc-sql/book_author.md
Normal file
@@ -0,0 +1,39 @@
|
||||
# 书籍作者表
|
||||
|
||||
## 基本信息
|
||||
|
||||
- 模块:book
|
||||
- 表名:`book_author`
|
||||
- 模型:`model/book/book_author.go`
|
||||
- 迁移接入:`initialize/gorm_biz.go`
|
||||
- 状态字典:`book_author_status`
|
||||
- 职责:承载书籍作者主体信息,用于作者资料展示、书籍作者关联和后台作者管理。
|
||||
|
||||
## 建议 SQL
|
||||
|
||||
> 以下 SQL 以当前项目 PostgreSQL 为准,主要表达字段、约束和索引语义;实际落库以 `GORM Model` 和 `initialize/gorm_biz.go` 为准。
|
||||
|
||||
```sql
|
||||
CREATE TABLE book_author (
|
||||
id bigserial PRIMARY KEY,
|
||||
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',
|
||||
intro text,
|
||||
cover_url varchar(500)
|
||||
);
|
||||
|
||||
COMMENT ON TABLE book_author IS '书籍作者表';
|
||||
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 '作者状态字典值,对应 book_author_status';
|
||||
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_created_at ON book_author (created_at);
|
||||
```
|
||||
Reference in New Issue
Block a user