Flyway

How to skip a specific migration with flyway?

谁说胖子不能爱 提交于 2020-01-12 06:42:31
问题 I'm using flyway with gradle, I've ran one of the migrations manually inside the database console, I want to run flyway, but tell it to ignore one specific migration version in between all the others. Can this be done ? 回答1: You would have to hack it a bit to get it to work, so I don't recommend this approach, but it would work in a pinch. I've only tested this with Maven, but I'm pretty sure it'd work with Gradle too. Migrate up until the version before the one you applied manually #

H2 and Oracle Compatiability issues

[亡魂溺海] 提交于 2020-01-11 05:32:07
问题 I am having an issue executing the following script using Flyway and H2 database. I assume its a Oracle compatibility issue but I am using H2 with the correct mode. This script is used to construct my tables in production but I want to use an in-memory database for testing purposes. Setup and error below. I don't want rewrite the scripts for an in-memory database if thats possible. Jdbc.properties jdbc.driver=org.h2.Driver jdbc.url=jdbc:h2:file:target/firmsoftDB;MODE=Oracle jdbc.username=sa

How does flyway / liquibase handle destructive upgrades in service?

筅森魡賤 提交于 2020-01-06 12:20:38
问题 Based on my understanding about flyway/liquibase, they provide ways to perform database upgrades through the pre configured scripts (SQL queries, Java files, etc.,). But i am not very much clear about the following : What happens if there is destructive upgrade. I have a use case like changing an bigint column(containing data) to date type. If i try to change it directly, i will end up with corrupted data for the column. How does flyway/liquibase handle these kinds of upgrades ? Whether pre

How to set timezone on postgresql jdbc connection created by flyway?

最后都变了- 提交于 2020-01-06 05:52:09
问题 I have a postgresql database that I deploy scripts to using flyway. I use the maven flyway plugin to launch the database build against the target database. In that build I have scripts that do things like: create table my_table( my_date_time timestamp with time zone not null ); insert into my_table(my_date_time) select '2000-01-01'; The postgresql database timezone is set to UTC. My client machine (that runs the maven/flyway build) is running CEST (UTC+2:00). When the scripts run, the

How can i use Flyway migration with single schema and multiple projects

╄→гoц情女王★ 提交于 2020-01-04 10:04:04
问题 How to manage multiple projects dealing with the same DB schema. The Flyway migration scripts in each of the project does not allow to start if it is modified by the other project. For example: I have a spring boot Project X with a FlywayInitializer class. @PostConstruct public void migrateFlyway() { final Flyway flyway = new Flyway(); flyway.setSchemas("schema1"); flyway.setLocations("classpath:x.migration"); flyway.migrate(); } And i have a submodule Project Y with also his own

How can i use Flyway migration with single schema and multiple projects

ε祈祈猫儿з 提交于 2020-01-04 10:03:11
问题 How to manage multiple projects dealing with the same DB schema. The Flyway migration scripts in each of the project does not allow to start if it is modified by the other project. For example: I have a spring boot Project X with a FlywayInitializer class. @PostConstruct public void migrateFlyway() { final Flyway flyway = new Flyway(); flyway.setSchemas("schema1"); flyway.setLocations("classpath:x.migration"); flyway.migrate(); } And i have a submodule Project Y with also his own

How can i use Flyway migration with single schema and multiple projects

为君一笑 提交于 2020-01-04 10:01:05
问题 How to manage multiple projects dealing with the same DB schema. The Flyway migration scripts in each of the project does not allow to start if it is modified by the other project. For example: I have a spring boot Project X with a FlywayInitializer class. @PostConstruct public void migrateFlyway() { final Flyway flyway = new Flyway(); flyway.setSchemas("schema1"); flyway.setLocations("classpath:x.migration"); flyway.migrate(); } And i have a submodule Project Y with also his own

Disabling Flyway Placeholder Validation

谁说我不能喝 提交于 2020-01-04 02:45:06
问题 So what I understood after upgrading my flyway version because of some requirements is that flyway-core-2.2 introduced some validation for Flyway placeholders. Now, the convention of placeholder syntax is ${name} uniform across most libraries. In our migration scripts, we are inserting a string in a mysql table column called stretchySql and that string holds some placeholder elements of our own which is meant to be interpreted at runtime by the application layer. UPDATE `stretchy_parameter`

Flyway specific migration with csv files

时光总嘲笑我的痴心妄想 提交于 2020-01-03 17:33:27
问题 We are using Flyway to keep up-to-date many databases in our test environments with sql scripts and it works fine. But we have a special need to also update databases with csv files. I know Flyway offers some Java based migrations to handle more complicated updates. But the problem is that these Java classes have the wanted version in their names, that would oblige us to recompile the class each time we want to use it. It would be more simple if we could drop our csv files in migration

Integration Testing with Flyway

旧城冷巷雨未停 提交于 2020-01-02 03:44:22
问题 I'm using Flyway to handle the database migration. Everything is working fine: the default location of the migration files is: main/resource/db/migration/V1... I am running integration tests and my setup uses an separate database schema for integration, which I would like to manage with flyway as well. The integration tests, though, are located in the test folder (not main ). When the Flyway bean executes migrate() , it doesn't find the migration files because they are in the main folder. If