Sql Script没有用liquibase执行

时间:2018-02-05 13:44:00

标签: java liquibase liquibase-hibernate

我有一个春季启动应用程序。我想在这个应用程序中使用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>

createTable.sql

CREATE TABLE IF NOT EXISTS dummy 
(
    id serial, name varchar(255));

application.properties

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

0 个答案:

没有答案