🚧 Fix bootstrap bug
This commit is contained in:
parent
a210b05661
commit
664e4243ef
7
pom.xml
7
pom.xml
@ -109,6 +109,13 @@
|
|||||||
|
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.hibernate.orm.tooling</groupId>
|
||||||
|
<artifactId>hibernate-enhance-maven-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<enableLazyInitialization>true</enableLazyInitialization>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>${quarkus.platform.group-id}</groupId>
|
<groupId>${quarkus.platform.group-id}</groupId>
|
||||||
<artifactId>quarkus-maven-plugin</artifactId>
|
<artifactId>quarkus-maven-plugin</artifactId>
|
||||||
|
|||||||
@ -30,6 +30,7 @@ public class RealmBootstrapService
|
|||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
AudienceStrategyRepo audienceStrategyRepo;
|
AudienceStrategyRepo audienceStrategyRepo;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
RoleBootstrapper roleBootstrapper;
|
RoleBootstrapper roleBootstrapper;
|
||||||
|
|
||||||
@ -45,10 +46,10 @@ public class RealmBootstrapService
|
|||||||
|
|
||||||
public RealmEntity run(String key, Realm realm)
|
public RealmEntity run(String key, Realm realm)
|
||||||
{
|
{
|
||||||
Optional<RealmEntity> existingRealm = realmRepo.findByIdOptional(key);
|
RealmEntity existingRealm = realmRepo.findByKey(key);
|
||||||
if (existingRealm.isPresent())
|
if (existingRealm != null)
|
||||||
{
|
{
|
||||||
return existingRealm.get();
|
return existingRealm;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,5 +1,3 @@
|
|||||||
quarkus.jvm-args=--add-opens java.base/java.lang=ALL-UNNAMED
|
|
||||||
|
|
||||||
quarkus.http.root-path=/api
|
quarkus.http.root-path=/api
|
||||||
quarkus.http.test-port=9089
|
quarkus.http.test-port=9089
|
||||||
quarkus.http.host=0.0.0.0
|
quarkus.http.host=0.0.0.0
|
||||||
@ -12,8 +10,6 @@ quarkus.http.cors.enabled=true
|
|||||||
|
|
||||||
# Postgres
|
# Postgres
|
||||||
prod.quarkus.hibernate-orm.validate-in-dev-mode=false
|
prod.quarkus.hibernate-orm.validate-in-dev-mode=false
|
||||||
quarkus.hibernate-orm.schema-management.strategy=none
|
|
||||||
%test,dev.quarkus.hibernate-orm.schema-management.strategy=none
|
|
||||||
quarkus.datasource.db-kind=postgresql
|
quarkus.datasource.db-kind=postgresql
|
||||||
|
|
||||||
%dev,test.quarkus.datasource.username=postgres
|
%dev,test.quarkus.datasource.username=postgres
|
||||||
@ -21,7 +17,7 @@ quarkus.datasource.db-kind=postgresql
|
|||||||
%dev,test.quarkus.datasource.jdbc.url=jdbc:postgresql://localhost:5432/postgres?currentSchema=auth
|
%dev,test.quarkus.datasource.jdbc.url=jdbc:postgresql://localhost:5432/postgres?currentSchema=auth
|
||||||
|
|
||||||
# Flyway
|
# Flyway
|
||||||
%dev,test.quarkus.flyway.clean-at-start=true
|
%dev,test.quarkus.flyway.clean-at-start=false
|
||||||
%dev.quarkus.flyway.locations=db/migration,db/dev
|
%dev.quarkus.flyway.locations=db/migration,db/dev
|
||||||
quarkus.flyway.migrate-at-start=true
|
quarkus.flyway.migrate-at-start=true
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user