Questions tagged [flyway]

1

votes
1

answer
73

Views

How do I get flyway.cmd to fail a build when no migration is necessary?

I've built a pipeline in Jenkins that uses Flyway. I'd like to run a command that returns a positive exit code so that the build step fails if no database migration is necessary. I could of course run flyway migrate and it would harmlessly do nothing, but I'd like to flag this to the end user as a...
David Atkinson
1

votes
0

answer
228

Views

Flyway GSS Authentication Failed Postgres Connection Error

When attempting to connect to our Postgres instance using Flyway, I get GSS Authentication failed connection error: Unable to obtain Jdbc connection from DataSource ( jdbc:postgresql://host/database? kerberosServerName=postgres& jaasApplicationName=pgjdbc ) for user '[email protected]': GSS Authe...
Brady Clifford
1

votes
0

answer
471

Views

Flyway:info fails with “Unable to obtain Jdbc connection from Datasource”

I attempt to run this command below: mvn -Dflyway.user=myusername -Dflyway.password=mypassword -Dflyway.url=jdbc:sqlserver://host:port;databaseName=mydbname flyway:info and it fails with: Unable to obtain Jdbc connection from DataSource Cannot open database 'mydbname' requested by the login. The log...
Flyway DB User
1

votes
0

answer
33

Views

Move schema_version during migration

I have a schema foo that, among other tables, contain schema_version and now I want to rename foo to bar as part of a migration like so ALTER SCHEMA foo RENAME TO bar. This migration currently fails since after the operation flyway is no longer able to find and update foo.schema_version as it is now...
RikardA
1

votes
1

answer
253

Views

Spring flyway configuration: cannot find placeholders when running sql

I am trying to run gradlew flywayMigrate, and the application chrashes when running a recurring migration with the error Caused by: org.flywaydb.core.api.FlywayException: No value provided for placeholder expressions: ${dbLinkHost}, ${dbLinkPassword}, ${dbLinkSid}, ${dbLinkUser}. Check your configu...
Androidas
1

votes
1

answer
617

Views

Spring Boot Application Tests with H2 Database and Flyway Fails to Seed

I have an application I am trying to test using H2. Here's my application.yml: spring: datasource: url: jdbc:h2:mem:appdb;DB_CLOSE_DELAY=-1;DATABASE_TO_UPPER=false jpa: database-platform: org.hibernate.dialect.H2Dialect flyway: url: jdbc:h2:mem:appdb;DB_CLOSE_DELAY=-1;DATABASE_TO_UPPER=false user:...
1

votes
0

answer
166

Views

Spring Boot: 2 in-memory databases, first one initialized by flyway, second manually

I have two H2 databases in my Spring boot application. Each of these databases is responsible for persistence of different entities. The first one is initialized by Flyway which works fine, but now I need to initialize the other H2 database. I think I have found out that it is impossible to initiali...
Marci-man
1

votes
0

answer
103

Views

Flyway baseline and outOfOrder together

I'm wondering, how is it possible to make Flyway baseline and outOfOrder work together? The outOfOrder flag can be used when you are working with branches, so if steps appear in the 'past' they are not set to 'Ignored' but they are executed after they appear. For example if they are arriving with a...
Alluir
1

votes
1

answer
474

Views

Execute just one SQL file via Flyway

I have multiple SQL files in my 'resources/sql/create' folder. I just want to run one SQL file via Flyway. But the following doesn't work: final Flyway flyway = new Flyway(); flyway.setDataSource(jdbcUrl, '', ''); flyway.setLocations('classpath:sql/create/create_table_person.sql'); flyway.clean(); f...
Julio D
1

votes
1

answer
125

Views

Spring Boot: Flyway migration before mybatis initialization

In my Spring Boot app I use Flyway for DB migrations and MyBatis together. Problem is that MyBatis is initialized before Flyway, so some DB operations are called (within @PostConstruct) before DB migration. If I take a look into FlywayAutoConfiguration there is: @AutoConfigureAfter({DataSourceAutoC...
Tomas Marik
1

votes
0

answer
31

Views

No password prompt returned to stdout when running script with nodejs' child_process.spwan(..)

I'm trying to create a utility that will squash flyway migrates. If I provide a password to the flyway conf file (so that no prompt is made), then the process runs as expected, however, in the case when a prompt for the flyway command should be generated (Which would consist of the text 'Database pa...
ZombieTfk
1

votes
1

answer
44

Views

Cannot run shell (which) command in PHP code

So I am working with Flyway and I run specific commands using PHP exec() function: exec('/path/absolute/flyway info'); These commands work as long as I specify the absolute path, but that may vary depending on the machines that it will be working on. That is why I want to use a variable which determ...
Nicu Zamfir
1

votes
2

answer
945

Views

How do I make FlyWay run my migrations? “Schema is up to date. No migration necessary.”

I have an existing database. I created two migrations $ ls src/main/resources/db/migration/ V1__create_stats.sql V2__create_sources.sql I set the following in application.properties # Prevent complaints when starting migrations with existing tables. flyway.baselineOnMigrate = true Otherwise it wou...
Chloe
1

votes
0

answer
480

Views

Using Spring, Error while retrieving the list of applied migration from metadata table “PUBLIC”. “schema_version”

Console log: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flywayInitializer' defined in class path resource [org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration$FlywayConfiguration.class]: Invocation of init method failed; nested e...
Hugi
1

votes
1

answer
55

Views

How can I prevent flyway callbacks from running when the target database is newer than the last migration present in the classpath?

I would like to stop the flyway callbacks (afterMigrate method in particular) from running if the database is newer than the last available migration file in the classpath. Flyway logs a warning in this scenario from the class DbMigrate: Schema 'public' has a version (11.2.5) that is newer than the...
Razvan
1

votes
0

answer
17

Views

Evaluate to use Flyway for a database that is not yours

I develop for a company that produces software for the banks, my boss asked me to evaluate the use of Flyway for our modification on the database of the bank, so far we pass them the scripts, I want to know is there any issue with an isolated database just like permission ...... Thanks in advance
Hos
1

votes
1

answer
380

Views

flyway-run both SQL and Java based scripts in remote location

Trying to run Java-based (compiled) migration files which are not in the project where Flyway is configured. Can anyone tell me is it possible to do so? I've created a jar which use flyway to do migrations. Jar expects an argument which is migration scripts' location. Migration scripts are in a diff...
Vinni
1

votes
0

answer
115

Views

SQL Error 586 When running batch scripts through Flyway

I am running some scripts through flyway migrate and I get this error in every script. The script itself runs but the next one doesn't. The prepared statement handle 3 is not valid in this context. Please verify that current database, user default schema, and ANSI_NULLS and QUOTED_IDENTIFIER set...
Abhi.Net
1

votes
0

answer
22

Views

Does FlyWay support Sybase IQ database?

According to FlyWay documentation it supports Sybase ASE. But does it support or plan to support Sybase IQ?
av37
1

votes
1

answer
58

Views

Hibernate DDL update SQL queries

I want to save change database scripts in my version control for log and history Or maybe use Flyway in feature. I use hibernate ddl-auto update mode in develop time to change and update database schema. How can get queries that hibernate apply to database when run app in ddl-auto=update mode? Does...
JworKer
1

votes
1

answer
213

Views

Spring Boot Flyway migrations not executed, SQL files are in JAR

I have a Spring Boot application using Flyway Migrations. Everything runs fine, from: within IntelliJ from the terminal on my macbook With 'fine' I mean, migration files are found, which are placed in src/main/resources and end up in the Spring Boot executable jar. However, when I run the jar from t...
JointEffort
1

votes
0

answer
706

Views

Fixing Detected resolved migration not applied to database

I have never worked with Flyway, but all of a sudden I'm managing it. It appears outOfOrder is false by default and I am now working with a failed migration that is blocking continuous deployment to our QA environment. I merged V21__alter_sequence.sql after V22__add_column.sql was already merged. Mi...
earthling
1

votes
0

answer
103

Views

Flyway 5.1.0 onwards not supporting SQL single-line comment starting with “--” but not followed by a whitespace

I upgraded from Flyway 5.0.7 to 5.1.4 for my Spring Boot application, then tried to run a unit test but it failed at DB migration step. My Flyway script contains a single-line comment starting with '--' but not followed by a whitespace. --Hello CREATE TABLE `products` ( `product_code` VARCHAR(10) NO...
wltheng
1

votes
0

answer
292

Views

Error in flyway migrations on h2Database since upgrading to spring boot v2

I have searched for solutions to this and haven't found anything. I have a service performing migrations via flyway. As part of integration tests for this service we use h2 database. Previously all tests and migrations worked on the h2 database when based off of Spring Boot version 1.5.9.RELEASE Sin...
CiaranP
1

votes
2

answer
120

Views

Spring Boot + Flyway + AWS: Caused by: java.sql.SQLException: No suitable driver found

I get this except in AWS Elastic Beanstalk, but the app works locally. 01-Aug-2018 07:44:54.815 SEVERE [localhost-startStop-1] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Cat...
Chloe
1

votes
1

answer
35

Views

Does Flyway support Phoenix?

Looks like Flyway did support phoenix as mentioned in the release note of version 4.0 However, when I look at compatible databases of the latest build, Phoenix is not listed. Does it mean Phoenix support has been dropped?
EteZ
1

votes
0

answer
73

Views

Flyway for databases containing billions of rows

I am looking for a schema manager (and probably not data) for my JAVA applications. I have multiple databases and tables with about 10+ billion rows. How can I introduce Flyway into my applications? Is there a way to let Flyway only manage my schema (can be kept in a central repository), that is, g...
umeshksingla
1

votes
2

answer
1.5k

Views

SpringBoot - Testing with Flyway and H2 database

I'm coding acceptance tests with Cucumber, and I want to use a H2 database for the tests. The application-test.properties looks like: server.port:8090 spring.jpa.database=H2 spring.database.driverClassName=org.h2.Driver spring.datasource.url:jdbc:h2:mem:database_user;DB_CLOSE_ON_EXIT=FALSE flyway.lo...
AleGallagher
1

votes
1

answer
54

Views

trying to get started with flyway on redshift

I am trying to get started with flyway (for Redshift) and go through the commandline tutorial flyway commandline tutorial Unfortunately, whatever command I issue, like 'flyway baseline' or 'flyway migrate' (I created a simple create table script in the sql folder) results in the same error message:...
Eric Mamet
1

votes
0

answer
45

Views

splitting flyway metatable schema_version and business data in two different databases possible?

It´s possible to configure flyway to use for the metatable (schema_version table) e.g. in PostgreSQL and for the migration scripts itself (mvn flyway:migrate) in another target database e.g. DB2? The background of my question: Flyway don´t support DB2 z/OS. My idea was, flyway should track the hi...
yilmazu
1

votes
0

answer
40

Views

How do you push the updated Postgres Docker image after Flyway runs in docker-compose

I have a docker-compose project where I use Flyway and Postgres Docker images to populate the Postgres database. This works fine and I can connect to the database. However I want to publish the database docker image for others to use in my organization without them needed to run the docker-compose...
Old Man Programmer
1

votes
0

answer
160

Views

Flyway setting placeholders programmatically

I have a very simple Spring Boot application which uses Flyway for database migrations. I want to set Flyway placeholders programmatically using Spring configuration class before migration starts. What I do is: @Configuration public class FlywayConfiguration { @Autowired private Flyway flyway; @V...
Christina
1

votes
0

answer
31

Views

After Integrating Flyway with Jenkins, Not able to view DBMS_OUTPUT in console

I'm using FLYWAY 5.1.4 Pro (Trial version) client : Command-line database :Oracle 12c operating system :Windows 8.x I started by integrating Flyway with Jenkins ,then In flyway.conf file ,set flyway.oracle.sqlplus=true After that I ran following Script- SET SERVEROUTPUT ON; BEGIN DBMS_OUTPUT.PUT_LI...
vnair3
1

votes
0

answer
171

Views

running flyway migrate in docker with oracle

I have a docker file which runs an install script. it fails to find oracle connection to run migrate. in my install script i set the export to oracle home and tns directory structure bin conf docker-compose-ccpdev1.yml Dockerfile HOSTNAMES.md include INSTALL.md install.sh README.md sql my Dockerfile...
shorif2000
1

votes
0

answer
31

Views

while doing alter on a table to add column we are getting timing out error via flyway

we are using flyway to do schema changes which is on MARIA DATABASE. while doing alter on a table we are getting timing out error via flyway. Alter table is just adding a column. this script is executing via flyway on spring boot application. classification table has 900k records. this is the scrip...
ashutosh tiwari
1

votes
0

answer
34

Views

migrate changes to multiple schemas

The way our database is designed, we have a different schema designated to different clients. So each DDL change needs to be applied to each schema. At the same time, when we roll out changes, we want to control which schemas get the changes in that particular migration. Essentially we want to migra...
Dharmendar Kumar 'DK'
1

votes
0

answer
122

Views

Flyway “ORA-00955: name is already used by an existing object”

We are trying to use Flyway to manage our database schema updates with the following spring-boot configuration: spring: datasource: driver-class-name: oracle.jdbc.OracleDriver password: ${java_user_password} url: ${DB_URL} username: JAVA_USER flyway: locations: classpath:/db/migration user: SUPER_US...
abdsahin
1

votes
0

answer
121

Views

How do I support multiple flyway migrations within the same schema?

We have a single Database with a schema per tenant. We have multiple microservices, each with their own database migration scripts. These microservice tables are created within each tenant schema. It appears that the flyway schema history table does not support this use case of having multiple indep...
Richard Bair
1

votes
1

answer
20

Views

Automatic database creation

Flyway is really nice for migrating database, but it needs something to migrate. An system might have addition and removal of applications each having their own database and credentials in a shared Postgres in Kubernetes for instance. Manual setup by a sysadmin or developer is not an option. What...
Erik Martino
1

votes
0

answer
162

Views

Use Sequence created by Flyway in JPA

I'm using a Spring Boot 2 / Flyway / Postgres setup. I want to achieve to let Flyway create a table with a sequence for automatic key iteration. JPA should recognize the sequence and use it. I let Flyway execute a PostgreSQL script: CREATE SEQUENCE config_id_seq; CREATE TABLE config ( ID BI...
Steve Benett

View additional questions