Spring Liquibase diff不适用于@SecondaryTable
如果我在spring boot/hibernate应用程序中添加一个具有辅助表的实体,定义如下(取自): 我运行liquibase diff命令来查看代码中的实体和底层数据库(PostgreSQL或MySQL-这无关紧要)之间的区别,我只得到一个更改集:Spring Liquibase diff不适用于@SecondaryTable,spring,hibernate,diff,liquibase,Spring,Hibernate,Diff,Liquibase,如果我在spring boot/hibernate应用程序中添加一个具有辅助表的实体,定义如下(取自): 我运行liquibase diff命令来查看代码中的实体和底层数据库(PostgreSQL或MySQL-这无关紧要)之间的区别,我只得到一个更改集: <changeSet author="jakub (generated)" id="1585730629323-1"> <createTable tableName="meal"> <colu
<changeSet author="jakub (generated)" id="1585730629323-1">
<createTable tableName="meal">
<column autoIncrement="true" name="id" type="BIGINT">
<constraints nullable="false" primaryKey="true" primaryKeyName="mealPK"/>
</column>
<column name="description" type="VARCHAR(255)"/>
<column name="name" type="VARCHAR(255)"/>
<column name="price" type="numeric(19, 2)"/>
</createTable>
</changeSet>
和liquibase postgresql.properties
是:
changeLogFile= src/main/resources/db/db.changelog.xml
driver= org.postgresql.Driver
url= jdbc:postgresql://localhost/myApp
username= postgres
password= password
referenceUrl= hibernate:spring:myapp.jpa.entity?dialect=org.hibernate.dialect.PostgreSQLDialect&hibernate.physical_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy&hibernate.implicit_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy
这里:这似乎是相同的问题,但没有回答
谢谢你的建议
<profile>
<id>db-diff-postgresql</id>
<build>
<plugins>
<plugin>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-maven-plugin</artifactId>
<version>3.8.7</version>
<executions>
<execution>
<id>generate-db-diff-postgresql</id>
<phase>process-test-resources</phase>
<goals>
<goal>diff</goal>
</goals>
<configuration>
<propertyFile>src/main/resources/db/liquibase-postgresql.properties</propertyFile>
<diffChangeLogFile>src/main/resources/db/changelogs/postgresql/changelog_diff_postgresql_${maven.build.timestamp}.xml</diffChangeLogFile>
<logging>debug</logging>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
changeLogFile= src/main/resources/db/db.changelog.xml
driver= org.postgresql.Driver
url= jdbc:postgresql://localhost/myApp
username= postgres
password= password
referenceUrl= hibernate:spring:myapp.jpa.entity?dialect=org.hibernate.dialect.PostgreSQLDialect&hibernate.physical_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy&hibernate.implicit_naming_strategy=org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy