Questions tagged [flyway]
Flyway by Boxfuse is an open-source database migration tool. It strongly favors simplicity and convention over configuration.
2,182
questions
0
votes
1
answer
35
views
Docker creates a database different from what i specify
I've been struggling with this issue for a good while now and I couldn't find any solution for this so I need your help. I'm using postgres image within Docker container and Java Spring. So basically ...
0
votes
1
answer
18
views
Pass database information from properties file in pom in spring boot
I want to use the flyway plugin, which requires in the pom the following configuration
<plugin>
<groupId>org.flywaydb</groupId>
<artifactId>...
0
votes
0
answers
14
views
Flywaydb - ERROR: invalid transaction termination
I am trying to update a large amount of data using batch.
CREATE OR REPLACE PROCEDURE update_table()
LANGUAGE plpgsql
AS
$$
DECLARE
-- variable declaration
total_records int;
batch_size ...
0
votes
0
answers
9
views
Setting a session variable in a flyway postgres migration?
I am attempting to run the following sql command in a flyway postgres migration:
SET pg_trgm.similarity_threshold = 0.1;
After the migrations are run, querying this variable shows that it was never ...
0
votes
2
answers
19
views
How to setup Flyway for snowflake on Windows
We are looking for auto deployment of database objects for snowflake. We came across flyway database migration tool and going through the documentation to perform the deployment to push the changes.
...
0
votes
0
answers
22
views
My migration does not work for my testing files
I am trying to migrate a testdb for tesitng. Everything else is working and the directory to the migrations is correct. However, it does not seem to be working. I am not sure what I am doing wrong. ...
0
votes
0
answers
17
views
flyway upgrade from 6.5.3 to 9.17 breaks and gives setFlywayLocations,Java migrations classpath is null
when i upgrade flyway from 6.5.3 to 9.17 i found that i have to include flyway-mysql and gson as dependency post that when i run migrations only .class files are recognised and .sql files are not ...
0
votes
0
answers
30
views
Flyway Baseline command throws error if flyway_schema_history already has migrations
I've been trying to create a new baseline for the flyway setup. I already have the complete setup and ran a few migrations already. Now, I want to setup a new baseline. On running the flyway baseline ...
0
votes
0
answers
38
views
Strange output of Flyway "info" command with baseline migration
For some reason, the last line is again the entry about baseline, although it is already higher on the list. Is this normal, or can something be done? Everything works fine, but it hurts my eyes a lot....
0
votes
1
answer
18
views
Spring Boot Autowire Service inside custom Flywayconfiguration
I use Flyway 8.5 and Springboot 2.7.
I am trying to call a function from a service after the migration of flyway has been completed (i.e. at an After_Migrate event) which adjusts the database again.
@...
0
votes
0
answers
21
views
Error during to run the command: gradle flywayRepair ... Caching disabled for task or how to restore the migration history table of flywaydb?
I have a project on Spring boot . I use flywaydb when working with postgresql scripts.
a row has been deleted from the migration history table. now, when trying to add migrations, an error happens:
...
0
votes
1
answer
74
views
docker compose flyway not connecting to postgres
When running docker compose up, I only get output from my postgres docker container. It seems that the flyway container is not even attempting to connect to the postgres container. I have also tried ...
1
vote
1
answer
55
views
Flyway - why all my schemas were deleted and how can i revert it
I was running a db repair command on my db, and surpassingly found out later that for each old migration version a new DELETE migration was created.
It was only effecting the flyway_schema_history ...
0
votes
0
answers
18
views
Store startup database changes through hibernate into a sql file
I have a complex startup import logic when starting up a spring boot server. In this startup process the database is filled with inital data structures which cannot be written directly in flyway or ...
0
votes
1
answer
40
views
flyway-ant: No database found to handle jdbc:
I'm trying to set up an ant build calling some of the flyway-ant targets, but I always end up with build failures saying
Flyway Error: No database found to handle jdbc:mariadb://<some_host>:3306/...
0
votes
1
answer
25
views
Spring boot Flyway Gradle dependency version auto inclusion
I am using Spring boot 2.7.5 and included dependency Flyway core 7.15.0 to execute migrations script on Psotgresql-9.6 but The IntelliJ-Idea external dependencies show Flyway core dependency 7.15.0 ...
0
votes
1
answer
36
views
FlywayException: Version may only contain 0..9 and . (dot). Invalid version: 1.....) at org.flywaydb.core.api.MigrationVersion.toBigInteger:271
I am building api with ktor, exposed and mysql. I am trying to use automated migration generation, but it throws an error.
so in src/main/db/migration/V1_create_users_table.kt
package db.migration
...
0
votes
1
answer
66
views
PostgreSQL migration from TEXT to INTEGER with existing data which can be null
I'm trying to perform alter table column change from TEXT to INTEGER in PostgreSQL database like below:
ALTER TABLE analyzer_parser_event
ALTER COLUMN error_id TYPE INTEGER USING (error_id::integer);
...
0
votes
0
answers
26
views
Jobrunr throwing flyway error when dockerizing application
I am using jobrunr-spring-boot-starter:5.0.1 with my spring boot application. I run my migrations using flyway. When not running inside docker, everything is working as expected. However, while ...
0
votes
0
answers
15
views
Unrecognized field at: "database.flyway" in Dropwizard application with flyway bundle
I'm working in a dropwizard application with a config.yml of
database:
driverClass: org.postgresql.Driver
user: ...
password: ...
url: jdbc:postgresql://localhost:5432/postgres
properties:
...
0
votes
0
answers
98
views
Flyway docker will auto restart after finishing migrate by docker compose commit
This is my first time using Flyway for Database migration. And it's a great tool for solving my problem of keeping the whole team using the same database and example data.
But there is a small problem....
0
votes
1
answer
201
views
Flyway Migrations have failed validation error only in H2 file mode
I was trying to run H2 file mode in Spring-boot with Flyway
I can see below error at the application start-up.
Caused by: org.flywaydb.core.api.exception.FlywayValidateException: Validate failed: ...
1
vote
0
answers
142
views
Test execution H2 SELECT query error Table not found and this database is empty
I have subject error in my Spring-boot application when running SELECT sql as part of integration tests.
However Spring-boot application start-up has no issues. I can see all the tables in H2 console ...
0
votes
0
answers
41
views
How to download and install flyway v7.15 or lower on ARM M1 chip
I am trying to standup a database container (mysql) that uses flyway migration to load the tables. Now it used to work just fine on my intel chip laptop but now I am trying it on m1 processor for the ...
1
vote
1
answer
64
views
Flyway with GitHub
I'm trying to use Flyway with GitHub Action? Does anyone have any sample workflow around that? New to this area and looking for some samples to get started.
Thanks in advance!
1
vote
1
answer
25
views
Flyway and different paths
I have sql files in 5 separate folders. I manage versions within each folder as below. All these sqls go under the same schema in the database. Is there a way to create .sql files under these folders ...
1
vote
1
answer
20
views
table dependencies and Flyway
I have parent with child tables (that is dependent on the parent table). Do I need to create one sql file for each child table and parent table? Or having one .sql file with parent and all its child ...
1
vote
1
answer
27
views
Detect if sql database has the following: Found non-empty schema 'foobar' without metadata table
If I run a certain test suite in our codebase, I end up with the this error when I try to start our spring boot app:
Caused by: com.googlecode.flyway.core.api.FlywayException: Found non-empty schema '...
0
votes
0
answers
256
views
getting message : Connection to localhost:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP cons
I'm getting this message: Connection to localhost:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections. i can't find what is wrong, please ...
1
vote
0
answers
68
views
Reusing Flyway Migrations between SpringBoot Tests (Zonky + Flyway + SpringBoot3)
I've been using Zonky Embedded DB Spring Tests + Flyway Spring Test to do integration testing with in-memory databases built from a collection of SQL migration scripts managed by Flyway. The issue I'...
1
vote
1
answer
83
views
Flyway relative path in gradle project [duplicate]
I have gradle spring-boot project.
I was trying to set the Flyway db migration files to different location using relative path.
flyway:
enabled: true
username: sa
password:
url: ...
0
votes
0
answers
143
views
Flyway execution SELECT [*]VALUE syntax error with h2 when strat Spring-boot Application
I faced below error when run Flyway enables with h2.
versions:
Spring Boot v2.7.8, Spring v5.3.25
"flyway", "7.2.1"
"h2", "2.1.214"
applcation yaml:
spring:
...
0
votes
0
answers
84
views
Postgres flyway COPY from CSV file
I am trying to run a COPY command from Flyway migration script to load csv file against PostgreSQL DB in a Spring Boot Project. I am getting the below error on this.
SQL State : 58P01
Error Code : 0
...
0
votes
0
answers
103
views
Flyway throws exception "HikariPool-1 Connection is not available" when trying to connect to GCP SQL
My Spring Boot application is using Flyway for db migrations and connects to Postgres in GCP Cloud.
It was working on JRE 11, but started to break after we upgraded to JRE 17.
The logs show that the ...
0
votes
1
answer
56
views
Inject quarkus bean to flyway java based migration
I need to write a migration to flyway using BaseJavaMigration or any other approach which allows implementing similar logic.
But I don't have my Quarkus context so I'm not able to do @Inject inside.
...
1
vote
1
answer
53
views
micronaut not creating table Flyway
I have a problem. I want the person table to be created when micronaut starts up. To do this, I use flyway, connected the dependency like this:
//----Micronaut Data
implementation("io....
1
vote
1
answer
114
views
Why doesn't Flyway skip baseline migration if all the previous migrations were executed?
I have over 250 migrations on my project, all executed on production. All the migrations were like this V1_249__migration_name, V1_250__migration_name... So I created new migration called ...
0
votes
0
answers
31
views
Circular reference issue in flyway migration while injecting Spring Data Repository
I'm trying to add a migration that requires a lot of business logic in it. And I'm struggling to find a way for spring to work together with flyway.
This is my migration file:
@Component
public class ...
0
votes
1
answer
35
views
How decrease flyway migration
I have more 200 migration of flyway at the moment on prod project. It's problem for my tests, because they run long time. Is there a right way for decrease count migration files? Maybe best way begin ...
0
votes
1
answer
299
views
Spring Boot Testcontainers PostgreSQL lunches multiple instances
A default version of postgres container is being created & used by spring instead of my own version.
I've created a test:
@SpringBootTest
@ExtendWith(SpringExtension.class)
@AutoConfigureMockMvc
@...
3
votes
1
answer
240
views
Problem connecting flyway with a postgres through ssl
I have a java application that was previously running with Postgres JDBC dependency version 42.2.5 and flyway version 5.2.1. These versions were coming from spring-boot-dependencies project. In this ...
0
votes
0
answers
21
views
FlywayDB not running migration scripts on startup
I am trying to get FlywayDB to work and run SQL- migration scripts on startup but it does not work and I have no real indication what might be wrong except the following message from the logs (see ...
0
votes
1
answer
65
views
FlywayException: Invalid migration state 'ignored'. Valid states are: [*, missing, pending, ıgnored, future]
I'm trying to run spring boot application using flyway and Mysql database. When I run the application, I'm getting below error.
Caused by: org.flywaydb.core.api.FlywayException: Invalid migration ...
0
votes
2
answers
152
views
Spring Boot Flyway Dealing with different environments and restrictions in enterprises
I am considering using Flyway for versioning database migrations for my Spring Boot API. I have been reading lots of article about it and I find that they talk mostly about setting it up which is ...
0
votes
0
answers
35
views
Flyway not taking file location folder into consideration
I use flyway 9.16.0 on macOS Ventura, installed via Homebrew.
My issue is that flyway does not take my flyway.locations into consideration.
My flyway.conf file looks like this:
flyway.locations=...
0
votes
0
answers
32
views
Issue in node-flywaydb migration?
I am utilizing the library https://www.npmjs.com/package/node-flywaydb in my Node.js project, but I am encountering the following error :
\node_modules\node-flywaydb\index.js'. Please verify that the ...
0
votes
2
answers
166
views
Postgresql: Can't access table created for application user
I'm working on a self education project. My current goal/blocker is to create PostgreSQL database setup with managed migrations that will have minimal required permissions for separate migration and ...
0
votes
0
answers
68
views
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server when run as flyway migration
in IntelliJ I created DDL script to add flyway and migrate schema to remote db. However there is some issue in syntax. When I run the script from console everything seems to be fine and tables are ...
1
vote
0
answers
49
views
Flyway apply migrations from an specific JAR dependency
I have some SQL migrations packed into a JAR (lets call it com.example:sql-migrations). Scripts are located in src/main/resources/db/migration in that package and are included inside the JAR.
In a ...
0
votes
1
answer
55
views
Cannot set start value of sequence in PostgreSQL
I am using migration script in my Spring Boot app and create a sequence as shown below:
CREATE SEQUENCE IF NOT EXISTS public.sequence_user START WITH 4 INCREMENT BY 5;
Then, in another migration file,...