diff --git a/build.gradle b/build.gradle index ef7c397..8b2bf6b 100644 --- a/build.gradle +++ b/build.gradle @@ -24,6 +24,7 @@ dependencies { implementation "org.apache.commons:commons-lang3" implementation "com.zaxxer:HikariCP" implementation 'org.springframework.boot:spring-boot-starter-actuator' + implementation 'org.liquibase:liquibase-core' testImplementation "org.springframework.boot:spring-boot-starter-test" runtimeOnly 'com.mysql:mysql-connector-j' testRuntimeOnly "org.junit.platform:junit-platform-launcher" diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 97efab7..687565b 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -14,9 +14,12 @@ spring: prepStmtCacheSize: 250 prepStmtCacheSqlLimit: 2048 useServerPrepStmts: true + liquibase: + enabled: true + change-log: classpath:db/changelog/db.changelog-master.xml jpa: hibernate: - ddl-auto: update + ddl-auto: none naming: physical-strategy: org.hibernate.boot.model.naming.CamelCaseToUnderscoresNamingStrategy implicit-strategy: org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy diff --git a/src/main/resources/db/changelog/db.changelog-master.xml b/src/main/resources/db/changelog/db.changelog-master.xml new file mode 100644 index 0000000..f703673 --- /dev/null +++ b/src/main/resources/db/changelog/db.changelog-master.xml @@ -0,0 +1,11 @@ + + + + + + + \ No newline at end of file diff --git a/src/main/resources/db/changelog/initial-schema.xml b/src/main/resources/db/changelog/initial-schema.xml new file mode 100644 index 0000000..0531718 --- /dev/null +++ b/src/main/resources/db/changelog/initial-schema.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file