0

Есть приложение Spring Boot, Maven, Java 11. Пробую создать скрипт для развертывания базы данных - ничего не происходит, конфигурации вроде все есть.

application.yaml

spring:
  datasource:
    username: username
    password: secret
    url: jdbc:postgresql://localhost:5432/base
    driver-class-name: org.postgresql.Driver
  liquibase:
    changeLogFile: classpath:/db/changelog/db.changelog-master.yaml

change-log.yaml

databaseChangeLog:
  - logicalFilePath: /db/changelog/db.changelog-master.yaml
  - changeSet:
    id: 1
    author: au
    changes:
      - createTable:
        tableName: table
        columns:
          - column:
              name: id
              type: long
              autoIncrement: true
              constraints:
                primaryKey: true
                nullable: false

pom.xml

<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>org.liquibase</groupId>
        <artifactId>liquibase-core</artifactId>
        <version>4.3.0</version>
    </dependency>

    <dependency>
        <groupId>org.postgresql</groupId>
        <artifactId>postgresql</artifactId>
        <version>42.2.18</version>
    </dependency>

    <dependency>
        <groupId>org.yaml</groupId>
        <artifactId>snakeyaml</artifactId>
        <version>1.27</version>
    </dependency>
</dependencies>

Structure:

-src
 -main
  -java
  -resources
   -db
    -changelog
     -db.changelog-master.yaml
   -application.yaml

Ошибок никаких при сборке не выдает

1 ответ 1

1

Попробуйте так

liquibase:
  change-log: classpath:db/changelog/db.changelog-master.yml

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge you have read our privacy policy.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.