-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Split post content to new table and support content version control #1617
Conversation
src/main/resources/migration/V6__migrate_split_content_to_content_table.sql
Outdated
Show resolved
Hide resolved
src/main/java/run/halo/app/model/dto/post/BasePostSimpleDTO.java
Outdated
Show resolved
Hide resolved
src/main/java/run/halo/app/service/base/BaseContentPatchLogService.java
Outdated
Show resolved
Hide resolved
cc @JohnNiang |
测试索引时发现 contents 表中的type字段没有用到,于是发现不需要这个字段,因为contents表的主键id设计为使用posts表的主键id,所以不需要像 post 和 sheet 共用表那样写,直接用一个 Content entity + ContentRespoitory + ContentService即可存储和使用post和sheet的内容,于是 commit#351d5c 用来优化此项发现,简化了300多行代码 |
@ruibaby @JohnNiang ready for review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
缺乏一些必要的单元测试,尤其是新增的 Content 部分。
src/test/java/run/halo/app/repository/ContentPatchLogRepositoryTest.java
Outdated
Show resolved
Hide resolved
@guqing 文章的描述似乎丢失了,请看图片: |
@JohnNiang 如何操作的呢 |
Hi @guqing ,左侧是基于 master 分支初始化博客,右侧则是基于当前 PR 初始化博客的结果。 |
* feat: split post content to new table and support content version control * feat: Improve post version management * feat: Add post content and version record deletion * feat: Add isInProcess attribute for post list and detail api * feat: Add migrate sql script * fix: Add a sql of allow origin_content to null in posts table * feat: Assign a value to the source of the post content version record
What this PR does?
Why we need it?
#1587
How to test it?
inProgress
字段Remark
对ContentPatchLog添加表索引测试情景如下:
1.Finds patchlogs by post id and status order by version
2.Finds patchlogs by post id and status and version order by version
3.Finds patchlogs by post id