Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KOGITO-7676: Implement Flyway migration for Runtimes persistence based on Quarkus #1404

Merged
merged 5 commits into from
Dec 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: "3"

services:
postgres-compose:
image: postgres:9.6
image: postgres:13.4-alpine3.14
environment:
POSTGRES_PASSWORD: pass
ports:
Expand All @@ -28,4 +28,4 @@ services:

networks:
postgres-compose-network:
driver: bridge
driver: bridge
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ quarkus.swagger-ui.always-include=true
kogito.persistence.type=jdbc

quarkus.datasource.db-kind=postgresql
quarkus.datasource.username=postgres
quarkus.datasource.password=changeme
quarkus.datasource.jdbc.url=jdbc:postgresql://localhost:5432/jdbc_test
quarkus.datasource.username=kogito-user
quarkus.datasource.password=kogito-pass
quarkus.datasource.jdbc.url=jdbc:postgresql://localhost:5432/kogito



Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ kogito.persistence.type=postgresql

quarkus.datasource.username=kogito-user
quarkus.datasource.password=kogito-pass
quarkus.datasource.jdbc.url=jdbc:postgresql://localhost:5432/kogito
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why changing from reactive to jdbc ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Flyway currently doesn't support the Hibernate- reactive, hence changing the URL with the JDBC.
For reference: quarkusio/quarkus#10716 (comment)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't that a regression ? cc @nmirasch @cristianonicolai

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@radtriste Flyway needs the JDBC datasource in order to work. Because this postgresql addon uses the Reactive driver, we need to include the jdbc url. Meaning, it now needs both jdbc and reactive, if users want Flyway.

quarkus.datasource.reactive.url=postgresql://localhost:5432/kogito

#run create tables scripts
kogito.persistence.auto.ddl=true

quarkus.flyway.migrate-at-start=true

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: "3"

services:
postgres-compose:
image: postgres:9.6
image: postgres:13.4-alpine3.14
environment:
POSTGRES_PASSWORD: pass
ports:
Expand All @@ -29,4 +29,4 @@ services:

networks:
postgres-compose-network:
driver: bridge
driver: bridge
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
Expand Down Expand Up @@ -101,6 +101,14 @@
<groupId>org.kie.kogito</groupId>
<artifactId>kogito-addons-springboot-persistence-postgresql</artifactId>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
server.address=0.0.0.0

#run create tables scripts during the application startup
kogito.persistence.auto.ddl=true
spring.flyway.enabled=true
spring.flyway.baseline-on-migrate=true

#jdbc
kogito.persistence.type=jdbc
spring.datasource.url=jdbc:postgresql://localhost:5432/jdbc_test
spring.datasource.username=postgres
spring.datasource.password=changeme
spring.datasource.url=jdbc:postgresql://localhost:5432/kogito
spring.datasource.username=kogito-user
spring.datasource.password=kogito-pass
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ kogito.persistence.type=postgresql
#Details https://www.postgresql.org/docs/9.6/static/libpq-connect.html#LIBPQ-CONNSTRING
kogito.persistence.postgresql.connection.uri=postgresql://kogito-user:kogito-pass@localhost:5432/kogito

spring.datasource.url=jdbc:postgresql://localhost:5432/kogito
spring.datasource.username=kogito-user
spring.datasource.password=kogito-pass
#run create tables scripts during the application startup
kogito.persistence.auto.ddl=true
spring.flyway.enabled=true
spring.flyway.baseline-on-migrate=true