h2 迁移到 mysql,Jhipster 5.7.2如何从H2迁移到mysql并保留我的修改

I created a jhipster project by selecting the h2 database option. I have made a lot of changes on my project and I want to switch to a mysql database to keep my data.

So I changed "devDatabaseType": "h2Disk", from the file yo-rc.json to "devDatabaseType": "mysql". However when I do the command "jhipster upgrade --force" or "jhipster" I lose all the modifications made on angular or my java project.

How can I migrate my database without losing my changes

(Update) After Edit :

src/main/resources/config/application-dev.yml

src/test/resources/config/application.yml

Delete **DatabaseConfiguration.java**

Edit **WebConfigurer.java**, **SecurityConfiguration.java

navbar.component.html** and **pom.xml** to remove references to H2

I get this error : stack trace

The complete project with the bug is available here : project

解决方案

No need to run jhipster upgrade for such a simple change.

Edit your src/main/resources/config/application-dev.yml to use mysql, copy datasource properties from application-prod.yml but don't set cache properties to true. Same thing for unit tests in src/test/resources/config/application.yml

Empty DatabaseConfiguration.java but keep the class for the @Enable* class annotations.

Edit WebConfigurer.java, SecurityConfiguration.javaand navbar.component.html to remove references to H2 console

Edit pom.xml or *.gradle to remove dependency on h2

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值