距离我们 2020 年 9 月 24 号发布 1.4.0 已经过去了 545 天了,期间虽然有一些版本更新,但大多数都是 patch 修复版本。终于,在今天正式发布 1.5.0 版本。其中带来了大量的优化更新,下面为大家简单介绍一些亮点功能,详细更新日志可在本文末尾查阅。

版本亮点

文章表拆分

在此版本中,新增了 contents 表专门用于存储文章内容。因为在以前的版本中,当站点有大量文章的时候会出现明显拖慢页面渲染速度的情况,这是因为在之前的版本中,查询文章列表会将内容字段也包含在其中,这就会导致数据越多就会越慢。所以在这个版本中,原本的 posts 表就不再包含 originalContentformatContent 字段,在列表查询的时候也不会包含。需要注意的是,如果你是从 1.4 版本升级的话,目前我们是没有自动清空这两个字段的内容的。当然,你可以手动清空,以获得更好的效果。

性能对比:

  • 版本:1.4.17 vs 1.5.0
  • 测试数据:文章数 1000,每篇 4000 字符。
  • 测试工具:Apache Benchmark
  • 测试平台:MacBook Pro M1 Pro
  • 测试参数:ab -c 100 -n 10000 http://localhost:8090/

1.4.17:

Screen Shot 2022-03-23 at 15.55.46

1.5.0:

Screen Shot 2022-03-23 at 16.03.46

注意:此测试可能并不是特别严谨,仅供参考。

文章保存逻辑修改

目前后台已经修改为直接保存编辑器渲染的 html 内容,保证编写时和最终发布结果完全一致。另外,数学公式和 mermaid 图表已经针对此特性做了优化。数学公式仅需在前台引入 katex css 即可。mermaid 图表会被渲染为 svg 并保存,所以无需再引入 mermaid 依赖。

数学公式可以在前台引入:

<link rel="stylesheet" href="https://unpkg.com/katex@0.12.0/dist/katex.min.css" />

目前,我们已经统一使用 @halo-dev/markdown-renderer 进行 Markdown 渲染。

编辑器重构

编辑器编辑区域修改为 Codemirror 编辑器,支持 Markdown 语法高亮,浏览文章会更加方便。

Screen Shot 2022-03-23 at 14.53.18

编辑器可以通过快捷键打开图片选择,目前也已经支持多选图片和选择之后直接插入文章。

Screen Shot 2022-03-23 at 14.52.41

预览区域支持代码块高亮。

Screen Shot 2022-03-23 at 14.51.53

支持更多 Markdown 标记语法。

Screen Shot 2022-03-23 at 14.54.15

表格编辑体验优化。总所周知,使用 Markdown 语法编写表格的体验是非常难受的,不仅编写困难,而且格式会非常难以阅读。所以我们使用了一个叫做 mte-kernel 的库来解决这个问题,不仅可以让编辑体验升级,而且会自动格式化表格。

CleanShot 2022-03-23 at 14.54.38

标签支持设置颜色

在这个版本中,我们添加了对标签设置颜色的功能,灵感来自于 GitHub Issues 的标签颜色。这样可以比较直观的区分不同的标签。

文章管理重构

重构了批量操作的逻辑,目前已经不需要提前通过文章状态筛选文章之后才能批量选择。可以任意批量选择之后进行文章状态的批量操作。

Screen Shot 2022-03-23 at 14.16.14

文章列表不再展示回收站的文章,改为单独为回收站提供一个入口。

Screen Shot 2022-03-23 at 14.16.00

文章设置弹窗进行了重构,改为更直观的显示方式,并且可以在弹窗中进行上下篇的切换。可以非常快速的预览文章设置并进行对文章设置的修改。

Screen Shot 2022-03-23 at 14.16.39

附件管理重构

目前支持将鼠标放在附件项即可显示勾选图标,不再需要提前进入批量管理功能。

Screen Shot 2022-03-23 at 14.15.17

附件详情也和文章设置一样,修改为弹窗的形式,可以进行上下项的快速切换,方便预览以及进行修改删除等操作。

Screen Shot 2022-03-23 at 14.15.32

主题设置重构

主题设置由原来的全屏抽屉形式改为单独的页面。并优化了布局,不再显示主题缩略图,将更多的空间留给设置表单。同时在界面上也展示了主题的相关信息。

Screen Shot 2022-03-23 at 14.17.16

Screen Shot 2022-03-23 at 14.18.44

版本日志

Breaking changes

Features

Improvements

Bug Fixes

Dependencies


halo-dev/halo@<tt>v1.4.17...v1.5.0</tt>

相关信息

1.4.17 升级到 1.5.0,原本 posts 表中的文章内容会自动迁移到新增的 contents 表中吗?
如果手动迁移,需要修改哪些参数/字段。(MySQL数据库)

    ttiv 不需要,会自动执行迁移脚本。如果需要手动我们肯定会提到。

    太棒了!终于解决了公式的问题。

    我升级1.5.0后,虽然容器创建成功了,但是发现网站打不开了,报错502 Bad Gateway,并且在宝塔面板上发现CPU占用率忽高忽低,一直不稳定
    服务器系统:腾讯云宝塔镜像 浏览器使用的是edge,然后更换浏览器清楚缓存也是一致,并且CDN加速也关闭了,回切版本1.4.17是可以正常访问的

      更新后,文章网易云音乐那个语法失效了
      不过关于界面还是正常

      Ryan Wang 👍

      2022-03-24 16:49:26.085  INFO 8 --- [main] o.e.jetty.server.AbstractConnector       : Stopped ServerConnector@401e02b4{HTTP/1.1, (http/1.1)}{0.0.0.0:8090}
      2022-03-24 16:49:26.085  INFO 8 --- [main] org.eclipse.jetty.server.session         : node0 Stopped scavenging
      2022-03-24 16:49:26.087  INFO 8 --- [main] o.e.j.s.h.ContextHandler.application     : Destroying Spring FrameworkServlet 'dispatcherServlet'
      2022-03-24 16:49:26.087  INFO 8 --- [main] o.e.jetty.server.handler.ContextHandler  : Stopped o.s.b.w.e.j.JettyEmbeddedWebAppContext@4f9e32f2{application,/,[file:///tmp/jetty-docbase.8090.2865079087758275756/, jar:file:/application/BOOT-INF/lib/springfox-swagger-ui-3.0.0.jar!/META-INF/resources],STOPPED}
      2022-03-24 16:49:26.111  INFO 8 --- [main] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
      2022-03-24 16:49:26.113  INFO 8 --- [main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown initiated...
      2022-03-24 16:49:26.217  INFO 8 --- [main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown completed.
      2022-03-24 16:49:28.940  INFO 7 --- [main] run.halo.app.Application                 : Starting Application v1.5.0 using Java 11.0.11 on f28886b1db3d with PID 7 (/application/BOOT-INF/classes started by root in /application)
      2022-03-24 16:49:28.943  INFO 7 --- [main] run.halo.app.Application                 : No active profile set, falling back to 1 default profile: "default"
      2022-03-24 16:49:30.055  INFO 7 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode!
      2022-03-24 16:49:30.056  INFO 7 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
      2022-03-24 16:49:30.344  INFO 7 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 278 ms. Found 24 JPA repository interfaces.
      2022-03-24 16:49:31.384  INFO 7 --- [main] org.eclipse.jetty.util.log               : Logging initialized @3478ms to org.eclipse.jetty.util.log.Slf4jLog
      2022-03-24 16:49:31.601  INFO 7 --- [main] o.s.b.w.e.j.JettyServletWebServerFactory : Server initialized with port: 8090
      2022-03-24 16:49:31.607  INFO 7 --- [main] org.eclipse.jetty.server.Server          : jetty-9.4.45.v20220203; built: 2022-02-03T09:14:34.105Z; git: 4a0c91c0be53805e3fcffdcdcc9587d5301863db; jvm 11.0.11+9
      2022-03-24 16:49:31.638  INFO 7 --- [main] o.e.j.s.h.ContextHandler.application     : Initializing Spring embedded WebApplicationContext
      2022-03-24 16:49:31.638  INFO 7 --- [main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 2623 ms
      2022-03-24 16:49:32.236  INFO 7 --- [main] run.halo.app.config.HaloConfiguration    : Halo cache store load impl : [class run.halo.app.cache.InMemoryCacheStore]
      2022-03-24 16:49:33.036  INFO 7 --- [main] o.hibernate.jpa.internal.util.LogHelper  : HHH000204: Processing PersistenceUnitInfo [name: default]
      2022-03-24 16:49:33.091  INFO 7 --- [main] org.hibernate.Version                    : HHH000412: Hibernate ORM core version 5.4.33
      2022-03-24 16:49:33.135  INFO 7 --- [main] o.hibernate.annotations.common.Version   : HCANN000001: Hibernate Commons Annotations {5.1.2.Final}
      2022-03-24 16:49:33.254  INFO 7 --- [main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Starting...
      2022-03-24 16:49:33.474  INFO 7 --- [main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Start completed.
      2022-03-24 16:49:33.510  INFO 7 --- [main] org.hibernate.dialect.Dialect            : HHH000400: Using dialect: org.hibernate.dialect.H2Dialect
      2022-03-24 16:49:34.717  INFO 7 --- [main] o.h.e.t.j.p.i.JtaPlatformInitiator       : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
      2022-03-24 16:49:34.727  INFO 7 --- [main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
      2022-03-24 16:49:35.472  INFO 7 --- [main] org.eclipse.jetty.server.session         : DefaultSessionIdManager workerName=node0
      2022-03-24 16:49:35.472  INFO 7 --- [main] org.eclipse.jetty.server.session         : No SessionScavenger set, using defaults
      2022-03-24 16:49:35.474  INFO 7 --- [main] org.eclipse.jetty.server.session         : node0 Scavenging every 600000ms
      2022-03-24 16:49:35.482  INFO 7 --- [main] o.e.jetty.server.handler.ContextHandler  : Started o.s.b.w.e.j.JettyEmbeddedWebAppContext@537360e3{application,/,[file:///tmp/jetty-docbase.8090.5659879011375603024/, jar:file:/application/BOOT-INF/lib/springfox-swagger-ui-3.0.0.jar!/META-INF/resources],AVAILABLE}
      2022-03-24 16:49:35.483  INFO 7 --- [main] org.eclipse.jetty.server.Server          : Started @7579ms
      2022-03-24 16:49:36.185  INFO 7 --- [main] run.halo.app.handler.file.FileHandlers   : Registered 9 file handler(s)

        Ryan Wang 👍

        SQL State  : 23505
        Error Code : 23505
        Message    : Unique index or primary key violation: "PRIMARY KEY ON PUBLIC.CONTENTS(POST_ID) [2, TIMESTAMP '2022-02-24 17:46:45.25', TIMESTAMP '2022-02-24 17:46:45.25', SPACE(206 /* table: 74 id: 67503 */), 2, SPACE(113 /* table: 74 id: 67504 */), 2, 0]"; SQL statement:
        -- Migrate post content to contents table
        INSERT INTO contents(post_id, status, patch_log_id, head_patch_log_id, content, original_content, create_time,
                             update_time)
        SELECT id,
               status,
               id,
               id,
               format_content,
               original_content,
               create_time,
               update_time
        FROM posts [23505-199]
        Location   : migration/V6__migrate_create_contents_table.sql (/application/BOOT-INF/classes/migration/V6__migrate_create_contents_table.sql)
        Line       : 2
        Statement  : -- Migrate post content to contents table
        INSERT INTO contents(post_id, status, patch_log_id, head_patch_log_id, content, original_content, create_time,
                             update_time)
        SELECT id,
               status,
               id,
               id,
               format_content,
               original_content,
               create_time,
               update_time
        FROM posts
        
        	at org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor.handleException(DefaultSqlScriptExecutor.java:277) ~[flyway-core-7.15.0.jar:na]
        	at org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor.executeStatement(DefaultSqlScriptExecutor.java:224) ~[flyway-core-7.15.0.jar:na]
        	at org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor.execute(DefaultSqlScriptExecutor.java:128) ~[flyway-core-7.15.0.jar:na]
        	at org.flywaydb.core.internal.resolver.sql.SqlMigrationExecutor.executeOnce(SqlMigrationExecutor.java:78) ~[flyway-core-7.15.0.jar:na]
        	at org.flywaydb.core.internal.resolver.sql.SqlMigrationExecutor.lambda$execute$0(SqlMigrationExecutor.java:67) ~[flyway-core-7.15.0.jar:na]
        	at org.flywaydb.core.internal.database.DefaultExecutionStrategy.execute(DefaultExecutionStrategy.java:27) ~[flyway-core-7.15.0.jar:na]
        	at org.flywaydb.core.internal.resolver.sql.SqlMigrationExecutor.execute(SqlMigrationExecutor.java:66) ~[flyway-core-7.15.0.jar:na]
        	at org.flywaydb.core.internal.command.DbMigrate.doMigrateGroup(DbMigrate.java:370) ~[flyway-core-7.15.0.jar:na]
        	... 42 common frames omitted
        Caused by: org.h2.jdbc.JdbcSQLIntegrityConstraintViolationException: Unique index or primary key violation: "PRIMARY KEY ON PUBLIC.CONTENTS(POST_ID) [2, TIMESTAMP '2022-02-24 17:46:45.25', TIMESTAMP '2022-02-24 17:46:45.25', SPACE(206 /* table: 74 id: 67503 */), 2, SPACE(113 /* table: 74 id: 67504 */), 2, 0]"; SQL statement:
        -- Migrate post content to contents table
        INSERT INTO contents(post_id, status, patch_log_id, head_patch_log_id, content, original_content, create_time,
                             update_time)
        SELECT id,
               status,
               id,
               id,
               format_content,
               original_content,
               create_time,
               update_time
        FROM posts [23505-199]
        	at org.h2.message.DbException.getJdbcSQLException(DbException.java:457) ~[h2-1.4.199.jar:1.4.199]
        	at org.h2.message.DbException.getJdbcSQLException(DbException.java:427) ~[h2-1.4.199.jar:1.4.199]
        	at org.h2.message.DbException.get(DbException.java:205) ~[h2-1.4.199.jar:1.4.199]
        	at org.h2.message.DbException.get(DbException.java:181) ~[h2-1.4.199.jar:1.4.199]
        	at org.h2.mvstore.db.MVPrimaryIndex.add(MVPrimaryIndex.java:131) ~[h2-1.4.199.jar:1.4.199]
        	at org.h2.mvstore.db.MVTable.addRow(MVTable.java:546) ~[h2-1.4.199.jar:1.4.199]
        	at org.h2.command.dml.Insert.addRowImpl(Insert.java:251) ~[h2-1.4.199.jar:1.4.199]
        	at org.h2.command.dml.Insert.insertRows(Insert.java:207) ~[h2-1.4.199.jar:1.4.199]
        	at org.h2.command.dml.Insert.update(Insert.java:132) ~[h2-1.4.199.jar:1.4.199]
        	at org.h2.command.CommandContainer.update(CommandContainer.java:133) ~[h2-1.4.199.jar:1.4.199]
        	at org.h2.command.Command.executeUpdate(Command.java:267) ~[h2-1.4.199.jar:1.4.199]
        	at org.h2.jdbc.JdbcStatement.executeInternal(JdbcStatement.java:233) ~[h2-1.4.199.jar:1.4.199]
        	at org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:205) ~[h2-1.4.199.jar:1.4.199]
        	at org.flywaydb.core.internal.jdbc.JdbcTemplate.executeStatement(JdbcTemplate.java:241) ~[flyway-core-7.15.0.jar:na]
        	at org.flywaydb.core.internal.sqlscript.ParsedSqlStatement.execute(ParsedSqlStatement.java:111) ~[flyway-core-7.15.0.jar:na]
        	at org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor.executeStatement(DefaultSqlScriptExecutor.java:212) ~[flyway-core-7.15.0.jar:na]
        	... 48 common frames omitted
        
        2022-03-24 17:28:31.432  INFO 7 --- [main] o.e.jetty.server.AbstractConnector       : Stopped ServerConnector@dada335{HTTP/1.1, (http/1.1)}{0.0.0.0:8090}
        2022-03-24 17:28:31.433  INFO 7 --- [main] org.eclipse.jetty.server.session         : node0 Stopped scavenging
        2022-03-24 17:28:31.434  INFO 7 --- [main] o.e.j.s.h.ContextHandler.application     : Destroying Spring FrameworkServlet 'dispatcherServlet'
        2022-03-24 17:28:31.435  INFO 7 --- [main] o.e.jetty.server.handler.ContextHandler  : Stopped o.s.b.w.e.j.JettyEmbeddedWebAppContext@2057d8ec{application,/,[file:///tmp/jetty-docbase.8090.3437815214235771536/, jar:file:/application/BOOT-INF/lib/springfox-swagger-ui-3.0.0.jar!/META-INF/resources],STOPPED}
        2022-03-24 17:28:31.461  INFO 7 --- [main] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
        2022-03-24 17:28:31.463  INFO 7 --- [main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown initiated...
        2022-03-24 17:28:31.562  INFO 7 --- [main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown completed.
        2022-03-24 17:28:34.241  INFO 7 --- [main] run.halo.app.Application                 : Starting Application v1.5.0 using Java 11.0.11 on e9e15c754199 with PID 7 (/application/BOOT-INF/classes started by root in /application)
        2022-03-24 17:28:34.243  INFO 7 --- [main] run.halo.app.Application                 : No active profile set, falling back to 1 default profile: "default"
        2022-03-24 17:28:35.423  INFO 7 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode!
        2022-03-24 17:28:35.424  INFO 7 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
        2022-03-24 17:28:35.690  INFO 7 --- [main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 257 ms. Found 24 JPA repository interfaces.
        2022-03-24 17:28:36.795  INFO 7 --- [main] org.eclipse.jetty.util.log               : Logging initialized @3586ms to org.eclipse.jetty.util.log.Slf4jLog
        2022-03-24 17:28:37.031  INFO 7 --- [main] o.s.b.w.e.j.JettyServletWebServerFactory : Server initialized with port: 8090
        2022-03-24 17:28:37.038  INFO 7 --- [main] org.eclipse.jetty.server.Server          : jetty-9.4.45.v20220203; built: 2022-02-03T09:14:34.105Z; git: 4a0c91c0be53805e3fcffdcdcc9587d5301863db; jvm 11.0.11+9
        2022-03-24 17:28:37.073  INFO 7 --- [main] o.e.j.s.h.ContextHandler.application     : Initializing Spring embedded WebApplicationContext
        2022-03-24 17:28:37.074  INFO 7 --- [main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 2763 ms
        2022-03-24 17:28:37.690  INFO 7 --- [main] run.halo.app.config.HaloConfiguration    : Halo cache store load impl : [class run.halo.app.cache.InMemoryCacheStore]
        2022-03-24 17:28:38.432  INFO 7 --- [main] o.hibernate.jpa.internal.util.LogHelper  : HHH000204: Processing PersistenceUnitInfo [name: default]
        2022-03-24 17:28:38.524  INFO 7 --- [main] org.hibernate.Version                    : HHH000412: Hibernate ORM core version 5.4.33
        2022-03-24 17:28:38.568  INFO 7 --- [main] o.hibernate.annotations.common.Version   : HCANN000001: Hibernate Commons Annotations {5.1.2.Final}
        2022-03-24 17:28:38.695  INFO 7 --- [main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Starting...
        2022-03-24 17:28:38.945  INFO 7 --- [main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Start completed.
        2022-03-24 17:28:38.979  INFO 7 --- [main] org.hibernate.dialect.Dialect            : HHH000400: Using dialect: org.hibernate.dialect.H2Dialect
        2022-03-24 17:28:40.202  INFO 7 --- [main] o.h.e.t.j.p.i.JtaPlatformInitiator       : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
        2022-03-24 17:28:40.213  INFO 7 --- [main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
        2022-03-24 17:28:40.984  INFO 7 --- [main] org.eclipse.jetty.server.session         : DefaultSessionIdManager workerName=node0
        2022-03-24 17:28:40.984  INFO 7 --- [main] org.eclipse.jetty.server.session         : No SessionScavenger set, using defaults
        2022-03-24 17:28:40.985  INFO 7 --- [main] org.eclipse.jetty.server.session         : node0 Scavenging every 600000ms
        2022-03-24 17:28:40.995  INFO 7 --- [main] o.e.jetty.server.handler.ContextHandler  : Started o.s.b.w.e.j.JettyEmbeddedWebAppContext@2f26634a{application,/,[file:///tmp/jetty-docbase.8090.3706645506939531129/, jar:file:/application/BOOT-INF/lib/springfox-swagger-ui-3.0.0.jar!/META-INF/resources],AVAILABLE}
        2022-03-24 17:28:40.996  INFO 7 --- [main] org.eclipse.jetty.server.Server          : Started @7788ms
        2022-03-24 17:28:41.699  INFO 7 --- [main] run.halo.app.handler.file.FileHandlers   : Registered 9 file handler(s)
        2022-03-24 17:28:44.898  INFO 7 --- [main] o.s.b.a.e.web.EndpointLinksResolver      : Exposing 4 endpoint(s) beneath base path '/api/admin/actuator'
        2022-03-24 17:28:44.961  INFO 7 --- [main] o.e.j.s.h.ContextHandler.application     : Initializing Spring DispatcherServlet 'dispatcherServlet'
        2022-03-24 17:28:44.961  INFO 7 --- [main] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
        2022-03-24 17:28:44.963  INFO 7 --- [main] o.s.web.servlet.DispatcherServlet        : Completed initialization in 2 ms
        2022-03-24 17:28:44.975  INFO 7 --- [main] o.e.jetty.server.AbstractConnector       : Started ServerConnector@7f2b39a{HTTP/1.1, (http/1.1)}{0.0.0.0:8090}
        2022-03-24 17:28:44.976  INFO 7 --- [main] o.s.b.web.embedded.jetty.JettyWebServer  : Jetty started on port(s) 8090 (http/1.1) with context path '/'
        2022-03-24 17:28:45.000  INFO 7 --- [main] run.halo.app.Application                 : Started Application in 11.331 seconds (JVM running for 11.792)
        2022-03-24 17:28:45.001  INFO 7 --- [main] run.halo.app.listener.StartedListener    : Starting migrate database...
        2022-03-24 17:28:45.082  INFO 7 --- [main] o.f.c.internal.license.VersionPrinter    : Flyway Community Edition 7.15.0 by Redgate
        2022-03-24 17:28:45.082  INFO 7 --- [main] o.f.c.i.database.base.BaseDatabaseType   : Database: jdbc:h2:file:~/.halo/db/halo (H2 1.4)
        2022-03-24 17:28:45.173  INFO 7 --- [main] o.f.core.internal.command.DbRepair       : Successfully repaired schema history table "PUBLIC"."flyway_schema_history" (execution time 00:00.045s).
        2022-03-24 17:28:45.174  INFO 7 --- [main] o.f.core.internal.command.DbRepair       : Manual cleanup of the remaining effects of the failed migration may still be required.
        2022-03-24 17:28:45.177  INFO 7 --- [main] o.f.c.internal.license.VersionPrinter    : Flyway Community Edition 7.15.0 by Redgate
        2022-03-24 17:28:45.204  INFO 7 --- [main] o.f.core.internal.command.DbValidate     : Successfully validated 16 migrations (execution time 00:00.022s)
        2022-03-24 17:28:45.230  INFO 7 --- [main] o.f.core.internal.command.DbMigrate      : Current version of schema "PUBLIC": 5
        2022-03-24 17:28:45.267  INFO 7 --- [main] o.f.core.internal.command.DbMigrate      : Migrating schema "PUBLIC" to version "6 - migrate create contents table"
        2022-03-24 17:28:45.280 ERROR 7 --- [main] o.f.core.internal.command.DbMigrate      : Migration of schema "PUBLIC" to version "6 - migrate create contents table" failed! Please restore backups and roll back database and code!
        2022-03-24 17:28:45.311  INFO 7 --- [main] ConditionEvaluationReportLoggingListener : 
        
        Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
        2022-03-24 17:28:45.333 ERROR 7 --- [main] o.s.boot.SpringApplication               : Application run failed
        
        org.flywaydb.core.internal.command.DbMigrate$FlywayMigrateException: Migration V6__migrate_create_contents_table.sql failed
        ------------------------------------------------------
        SQL State  : 23505
        Error Code : 23505
        Message    : Unique index or primary key violation: "PRIMARY KEY ON PUBLIC.CONTENTS(POST_ID) [2, TIMESTAMP '2022-02-24 17:46:45.25', TIMESTAMP '2022-02-24 17:46:45.25', SPACE(206 /* table: 74 id: 67503 */), 2, SPACE(113 /* table: 74 id: 67504 */), 2, 0]"; SQL statement:
        -- Migrate post content to contents table
        INSERT INTO contents(post_id, status, patch_log_id, head_patch_log_id, content, original_content, create_time,
                             update_time)
        SELECT id,
               status,
               id,
               id,
               format_content,
               original_content,
               create_time,
               update_time
        FROM posts [23505-199]
        Location   : migration/V6__migrate_create_contents_table.sql (/application/BOOT-INF/classes/migration/V6__migrate_create_contents_table.sql)
        Line       : 2
        Statement  : -- Migrate post content to contents table
        INSERT INTO contents(post_id, status, patch_log_id, head_patch_log_id, content, original_content, create_time,
                             update_time)
        SELECT id,
               status,
               id,
               id,
               format_content,
               original_content,
               create_time,
               update_time
        FROM posts