Spring Boot-Liquibase不会创建DATABASECHANGELOG表

时间:2018-10-25 17:22:23

标签: database spring-boot liquibase

我有一个Spring Boot应用程序。
而且我的Liquibase不会创建DATABASECHANGELOG表。
它处理变更日志,然后引发错误。
有什么主意吗?
缺了点什么?

错误:

Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'addressbook.DATABASECHANGELOG' doesn't exist

config:

spring:
  jpa:
    show-sql: false
    hibernate:
      ddl-auto: none
  datasource:
    url: jdbc:mysql://localhost:3306/addressbook?characterEncoding=UTF-8
    username: root
    password: root
    driver-class-name: com.mysql.jdbc.Driver
  liquibase:
    enabled: true
    change-log: "classpath:db/liquibase-changelog.yml"

变更日志:

databaseChangeLog:
- changeSet:
    id: 1
    author: me
    changes:
    - sqlFile:
        path: sql/20181025_startup.sql
        relativeToChangelogFile: true
        stripComments: true
- changeSet:
    id: 2
    author: me
    changes:
    - sqlFile:
        path: sql/20181026_create_table_contacts.sql
        relativeToChangelogFile: true
        stripComments: true

依赖性:

gradleVersion=4.10.2
springCloudVersion=Finchley.SR2
springBootVersion=2.0.6.RELEASE
mysqlVersion=5.1.47
liquibaseVersion=3.6.2

0 个答案:

没有答案