集成数据库:PostgreSQL
- 引入pom文件
打开biz业务模块的pom.xml
文件`:
注释掉如下代码:
<dependency>
<groupId>org.anyline</groupId>
<artifactId>anyline-data-jdbc-mysql</artifactId>
</dependency>
引入pg的jar包:
<dependency>
<groupId>org.anyline</groupId>
<artifactId>anyline-data-jdbc-postgresql</artifactId>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
</dependency>
- 修改数据库连接:
打开application.yml
文件:
按照实际环境修改配置:
datasource:
##数据库地址
url: jdbc:postgresql://localhost:15432/flyflow_pro
driver-class-name: org.postgresql.Driver
##数据库账号
username: postgres
##数据库密码
password: 123456
- 若采用自动生成Flowable脚本,即不执行
flowable.sql
,则需要先打开文件FlowableConfig.java
,注释掉如下代码:
springProcessEngineConfiguration.setTransactionManager(platformTransactionManager);
springProcessEngineConfiguration.setDataSource(sqlSessionFactory.getConfiguration().getEnvironment().getDataSource());
等Flowable的表都生成了之后,关闭项目,重新打开刚才注释的代码,重新启动项目即可。
- 导入数据库脚本: 项目中未单独创建pg的数据库脚本,可以先执行mysql的,然后通过
navicat
导入到pg库即可