Liquibase diffChangeLog针对Hibernate映射定义 [英] Liquibase diffChangeLog against a Hibernate mapping definition
问题描述
这个问题与 Hibernate使用JPA(带注释的实体)和liquibase 。
我真的很想知道在执行Liquibase diff和Hibernate映射定义时会发生什么。
看起来会产生什么:一个liquibase changelog,它将我的hibernate映射状态迁移到数据库的当前映像。 b
我期待的是什么:一个liquibase changelog,用于迁移现有(旧)数据库以反映我的(新)hibernate映射中的更改。
我是否期待错误的事情?或者我做错了什么?
谢谢你让我知道!
J。
答案太明显了......
这只是翻转基础系统和目标系统的问题: - )
--username = un \\ \\
--password = pw \
--url = jdbc:mysql:/// mydb \
diffChangeLog \
--baseUrl =hibernate:/ hibernate .hbm.xml
成为:
--url =hibernate:/hibernate.hbm.xml\
diffChangeLog \
--baseUrl = jdbc: mysql:/// mydb \
--baseUsername = un \
--basePassword = pw
对不起!
睡觉时间: - )
This question is related to "Hibernate using JPA (annotated Entities) and liquibase".
I was actually wondering what to expect when doing a Liquibase diff against a Hibernate mapping definition.
What it seems to produce: A liquibase changelog that migrates the state of my hibernate mappings to the current image of the database.
What I was hoping for: A liquibase changelog that migrates the existing (old) database to reflect the changes in my (new) hibernate mappings.
Am I expecting the wrong thing? or am I doing something wrong?
Thank you for letting me know! J.
The answer was too obvious...
It was just a matter of flipping the base- and target system :-)
--username=un \
--password=pw \
--url=jdbc:mysql:///mydb \
diffChangeLog \
--baseUrl="hibernate:/hibernate.hbm.xml"
becomes:
--url="hibernate:/hibernate.hbm.xml" \
diffChangeLog \
--baseUrl=jdbc:mysql:///mydb \
--baseUsername=un \
--basePassword=pw
Sorry! Time for sleep :-)
这篇关于Liquibase diffChangeLog针对Hibernate映射定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!