我有一个弹簧启动应用程序。我想在这个应用程序中使用 liquibase 我在 pom.xml 中添加了 liquibase 依赖项。请在下面找到“liquibase-changelog.xml”文件详细信息:-
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd">
<changeSet author="iftekharkhan" id="changeset-1">
<sqlFile dbms="postgres" encoding="utf8" path="changelog/createTable.sql"
relativeToChangelogFile="true" />
</changeSet>
</databaseChangeLog>
创建表.sql
CREATE TABLE IF NOT EXISTS dummy
(
id serial, name varchar(255));
应用程序属性
spring.datasource.platform=postgres
spring.datasource.url=jdbc:postgresql://localhost:5432/postgres
spring.datasource.username=postgres
spring.datasource.password=Sunny@310591
spring.jpa.show-sql=true
spring.jpa.hibernate.ddl-auto=update
spring.jpa.properties.hibernate.default_schema=flow
liquibase.change-log=classpath:db/liquibase-changelog.xml
spring.datasource.driver=org.postgresql.Driver
hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
即使在运行我的应用程序之后,该表也没有在数据库中创建。任何人都可以请帮助我我哪里出错了!
日志:-
INFO 2/5/18 11:12 PM: liquibase: Successfully acquired change log lock
INFO 2/5/18 11:12 PM: liquibase: Reading from public.databasechangelog
INFO 2/5/18 11:12 PM: liquibase: classpath:db/liquibase-changelog.xml: classpath:db/liquibase-changelog.xml::changeset-3::iftekharkhan: ChangeSet classpath:db/liquibase-changelog.xml::changeset-3::iftekharkhan ran successfully in 1ms
INFO 2/5/18 11:12 PM: liquibase: Successfully released change log lock