-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9390 from Sanne/multitenancy-ci
Enable Hibernate ORM multitenancy IT on CI
- Loading branch information
Showing
9 changed files
with
38 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 7 additions & 7 deletions
14
integration-tests/hibernate-tenancy/src/main/resources/application.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,38 @@ | ||
# Hibernate ORM settings | ||
quarkus.hibernate-orm.database.generation=none | ||
quarkus.hibernate-orm.multitenant=DATABASE | ||
quarkus.hibernate-orm.validate-tenant-in-current-sessions=false | ||
|
||
# Maria DB URL | ||
mariadb.url=jdbc:mariadb://localhost:3306 | ||
|
||
# Default DB Configuration | ||
quarkus.datasource.db-kind=mariadb | ||
quarkus.datasource.username=root | ||
quarkus.datasource.password=secret | ||
quarkus.datasource.jdbc.url=${mariadb.url}/hibernate_orm_test | ||
quarkus.datasource.jdbc.url=${mariadb.base_url}/hibernate_orm_test | ||
quarkus.datasource.jdbc.max-size=1 | ||
quarkus.datasource.jdbc.min-size=1 | ||
quarkus.flyway.migrate-at-start=true | ||
#Reset Flyway metadata at boot, as the database might have been tainted by previous integration tests: | ||
quarkus.flyway.clean-at-start=true | ||
quarkus.flyway.locations=classpath:database/default | ||
|
||
# DATABASE Tenant 'base' Configuration | ||
quarkus.datasource.base.db-kind=mariadb | ||
quarkus.datasource.base.username=jane | ||
quarkus.datasource.base.password=abc | ||
quarkus.datasource.base.jdbc.url=${mariadb.url}/base | ||
quarkus.datasource.base.jdbc.url=${mariadb.base_url}/base | ||
quarkus.datasource.base.jdbc.max-size=1 | ||
quarkus.datasource.base.jdbc.min-size=1 | ||
quarkus.flyway.base.migrate-at-start=true | ||
quarkus.flyway.base.clean-at-start=true | ||
quarkus.flyway.base.locations=classpath:database/base | ||
|
||
# DATABASE Tenant 'mycompany' Configuration | ||
quarkus.datasource.mycompany.db-kind=mariadb | ||
quarkus.datasource.mycompany.username=john | ||
quarkus.datasource.mycompany.password=def | ||
quarkus.datasource.mycompany.jdbc.url=${mariadb.url}/mycompany | ||
quarkus.datasource.mycompany.jdbc.url=${mariadb.base_url}/mycompany | ||
quarkus.datasource.mycompany.jdbc.max-size=1 | ||
quarkus.datasource.mycompany.jdbc.min-size=1 | ||
quarkus.flyway.mycompany.migrate-at-start=true | ||
quarkus.flyway.mycompany.clean-at-start=true | ||
quarkus.flyway.mycompany.locations=classpath:database/mycompany | ||
|
8 changes: 4 additions & 4 deletions
8
...on-tests/hibernate-tenancy/src/main/resources/database/default/V1.0.0__init_databases.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
CREATE DATABASE base; | ||
CREATE USER 'jane'@'%' IDENTIFIED BY 'abc'; | ||
CREATE DATABASE IF NOT EXISTS base; | ||
CREATE USER IF NOT EXISTS 'jane'@'%' IDENTIFIED BY 'abc'; | ||
GRANT ALL privileges ON base.* TO 'jane'@'%'; | ||
|
||
CREATE DATABASE mycompany; | ||
CREATE USER 'john'@'%' IDENTIFIED BY 'def'; | ||
CREATE DATABASE IF NOT EXISTS mycompany; | ||
CREATE USER IF NOT EXISTS 'john'@'%' IDENTIFIED BY 'def'; | ||
GRANT ALL privileges ON mycompany.* TO 'john'@'%'; | ||
|
||
FLUSH PRIVILEGES; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters