From 5f4620eb339800bfa6e8013819cfa526dd034107 Mon Sep 17 00:00:00 2001 From: Andreas Dinauer Date: Mon, 6 Apr 2026 12:34:42 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A7=20Add=20flyway?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 8 ++++++++ src/main/resources/application.properties | 6 +++++- src/main/resources/db/migration/V1.0.0__init.sql | 15 +++++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 src/main/resources/db/migration/V1.0.0__init.sql diff --git a/pom.xml b/pom.xml index 1e7d895..e7edbe1 100644 --- a/pom.xml +++ b/pom.xml @@ -51,6 +51,14 @@ io.quarkus quarkus-hibernate-orm-panache + + io.quarkus + quarkus-flyway + + + org.flywaydb + flyway-database-postgresql + org.apache.commons commons-lang3 diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 61a9aa9..a5446a7 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -12,4 +12,8 @@ oidc.proxy.client.redirect=http://localhost:3000 %dev,test.quarkus.datasource.password=postgres %dev,test.quarkus.datasource.jdbc.url=jdbc:postgresql://localhost:5432/postgres?currentSchema=oidc-proxy -%dev,test.oidc.proxy.crypto.secret=test \ No newline at end of file +%dev,test.oidc.proxy.crypto.secret=test + +%dev,test.quarkus.flyway.clean-at-start=true +%dev.quarkus.flyway.locations=db/migration,db/dev +quarkus.flyway.migrate-at-start=true \ No newline at end of file diff --git a/src/main/resources/db/migration/V1.0.0__init.sql b/src/main/resources/db/migration/V1.0.0__init.sql new file mode 100644 index 0000000..f9ac0ae --- /dev/null +++ b/src/main/resources/db/migration/V1.0.0__init.sql @@ -0,0 +1,15 @@ +create table access_token +( + expires_at timestamp(6) with time zone, + id varchar(255) not null + primary key, + token text +); + +create table refresh_token +( + expires_at timestamp(6) with time zone, + id varchar(255) not null + primary key, + token text +); \ No newline at end of file