1. application.properties增加如下配置
spring.activiti.database-schema-update=false
spring.activiti.db-history-used=false
spring.activiti.db-identity-used=false
2. 视图sql
![](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
-- 修改表名称 ALTER TABLE act_id_user RENAME act_id_user_bak1; ALTER TABLE act_id_group RENAME act_id_group_bak1; ALTER TABLE act_id_membership RENAME act_id_membership_bak1; -- activit用户视图 CREATE OR REPLACE VIEW `microarch_dev`.`act_id_user` AS (SELECT user_name AS ID_, NULL AS REV_, fullname AS FIRST_, fullname AS LAST_, email AS EMAIL_, PASSWORD AS PWD_, NULL AS PICTURE_ID_ FROM sys_user_); -- activit角色视图 CREATE OR REPLACE VIEW `microarch_dev`.`act_id_group` AS (SELECT role_code AS ID_, NULL AS REV_, role_name AS NAME_, NULL AS TYPE_ FROM sys_role_) ; -- activit用户角色关系视图 CREATE OR REPLACE VIEW `microarch_dev`.`act_id_membership` AS (SELECT (SELECT user_name FROM sys_user_ su WHERE su.id = sur.user_id) AS USER_ID_, (SELECT role_code FROM sys_role_ sr WHERE sr.id = sur.role_id) AS GROUP_ID_ FROM sys_user_role_ sur) ; -- 查询 SELECT * FROM act_id_user; SELECT * FROM act_id_group; SELECT * FROM act_id_membership;
参考:https://blog.csdn.net/an341221/article/details/79003035