私はスプリングブートアプリケーションを持っています。このアプリケーションで 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));
アプリケーションのプロパティ
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
アプリケーションを実行した後でも、このテーブルは DB に作成されません。誰でも私がどこで間違っているのか教えてください!
ログ:-
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