我试图为博客文章设计一个数据库,它可以被修改,并且可以显示不同的版本。一般来说,流程如下所示:
本文的当前DB模式如下所示:

也不符合我的要求。我不知道如何在数据库中对适度过程建模,并给出可能的拒绝原因。因此,考虑到所有这些,什么是最好的方法?
发布于 2020-09-18 18:04:59
根据你在评论中提出的问题,我将把审查历史安排如下:
create table article_review_status (
article_review_status_id int generated always as identity,
status_code text not null unique
);
create table article_review (
article_review_id int generated always as identity,
article_revision_id int not null
references article_revision(article_revision_id),
article_review_status_id int not null
references article_review_status(article_review_status_id),
entry_at timestamptz not null default now(),
article_review_comments text,
reviewer_id int not null
references users(user_id) -- <-- Would this be another author or an admin?
);然后,应用程序可以确定是否使article可见。
https://stackoverflow.com/questions/63959779
复制相似问题