flowable踩坑记录

354 阅读1分钟

背景

在构建项目jeecgflow过程中,出现了启动异常。我们这边用的是JeecgBoot3.6.2集成flowable6.7.2。大家可以参考之前的文章,有讲解jeecgboot如何集成flowable
在集成之后,确实可以正常启动, 然后我们就开始了模型建模了。
然后再次启动项目,就出现了如下的报错信息了。

//部分报错信息摘抄如下。
Caused by: liquibase.exception.DatabaseException: 
Table 'act_dmn_deployment' already exists

Caused by: org.flowable.common.engine.api.FlowableException: 
Error updating dmn engine tables

Caused by: org.flowable.common.engine.api.FlowableException: 
Error initialising dmn data model
Invocation of init method failed; nested exception is 
org.flywaydb.core.internal.command.DbMigrate$FlywayMigrateException:
Migration V3.6.2__all_upgrade.sql failed

SQL State  : 42S21
Error Code : 1060
Message    : Duplicate column name 'visits_num'
Location   : flyway/sql/mysql/V3.6.2__all_upgrade.sql
Error creating bean with name 'flywayInitializer' defined in class path resource
[org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration$FlywayConfiguration.class]: Invocation of init method failed; nested exception is 
org.flywaydb.core.api.exception.FlywayValidateException: Validate failed: Migrations have failed validation

Detected failed migration to version 3.6.2 (all upgrade). 
Please remove any half-completed changes then run repair to fix the schema history.

删除表中记录的有错误的sql并重新跑, 将flyway_schema_history中的数据进行清除。

Caused by: org.flywaydb.core.internal.command.DbMigrate$FlywayMigrateException:
Migration V3.6.2__all_upgrade.sql failed

Caused by: java.sql.SQLSyntaxErrorException: Duplicate column name 'visits_num'