Vishal Kawade
Vishal Kawade

Reputation: 443

Flyway doesn't create schema version table in provided schema

I am working with flyway and spring boot. 2.x.x. I am able to execute successfully.

But flyway generates new schema based on my username and write flyway history table into that. As I want to be in my schema. For that I have set properties

    flyway.schemas=xyz

But it not creating that table into specified schema xyz.

Help will be appreciated.

Upvotes: 2

Views: 1534

Answers (3)

Avinash Gupta
Avinash Gupta

Reputation: 228

The default configuration file name is flyway.properties and it should reside in the same directory as the pom.xml file. Encoding is specified by flyway.encoding (Default is UTF-8).

flyway.user=databaseUser
flyway.password=databasePassword
flyway.schemas=schemaName

Also, as @Benoit commented, the user should have proper access rights for the specified schema.

Upvotes: 1

Serg Vasylchak
Serg Vasylchak

Reputation: 874

I believe FlywayProperties are read from configuration properties with prefix spring.flyway

spring.flyway.schemas=xyz

Upvotes: 5

Benoit
Benoit

Reputation: 5394

This behavior does not come from flyway but rather from the underlying database.

Check that this user has the proper rights to:

  • Read/Write data in this schema.
  • Create a table in this schema.

Upvotes: 0

Related Questions