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

Define schema #339

Open
faeb5 opened this issue Feb 8, 2023 · 1 comment
Open

Define schema #339

faeb5 opened this issue Feb 8, 2023 · 1 comment

Comments

@faeb5
Copy link

faeb5 commented Feb 8, 2023

Hi, is it possible to specify a default schema that will be used to clean and migrate the database? I'm writing unit tests in a Quarkus project using a H2 database. All of the entities are configured to use a certain database schema.

However, in the test logs I can see that all the clean and migrate scripts are executed using the default schema of the database (which is called PUBLIC and not my database schema).

A possible workaround for the migration scripts is to add the line SET SCHEMA MYSCHEMA at the beginning of the SQL script, but the clean method after each test will not work because it tries to clean the wrong schema.

Is there a way to specify the used database schema?

@radcortez
Copy link
Owner

I believe this can be done by setting the default schema used by Flyway:
https://flywaydb.org/documentation/configuration/parameters/defaultSchema

I didn't try, but the extension should read the flyway configuration file or environment variables. Can you try it and let me know if this works for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants