From c727cd7b9b1b32de0e7e7d16886500de22920abb Mon Sep 17 00:00:00 2001 From: Mohamed Bilel Besrour Date: Sun, 29 Sep 2024 04:09:53 +0200 Subject: [PATCH] add liquibase --- build.gradle | 1 + src/main/resources/application.yml | 5 +++- .../db/changelog/db.changelog-master.xml | 11 +++++++++ .../resources/db/changelog/initial-schema.xml | 23 +++++++++++++++++++ 4 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 src/main/resources/db/changelog/db.changelog-master.xml create mode 100644 src/main/resources/db/changelog/initial-schema.xml 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