Flyway

Best practice: How to modify flyway migration script after it has been used

不羁岁月 提交于 2019-12-04 01:46:39
I am looking for advise in the following case. I set up flyway and migration scripts in my productive environment. On every deployment the database will be migrated to the current version. I already have created several migrations scripts which have been applied to the productive database. Recently I upgraded my development MySQL tools which now include warnings about usage of deprecated functions and other warnings. These warnings have not been displayed in the old version. Of course I would like to fix the warnings, especially for the case when a future version of the database does not

How configure logging for Flyway command line

a 夏天 提交于 2019-12-03 21:35:53
Here on my job we started the use of flyway and the databases admins asked to me if the flyway has a log. After read some articles on internet and on documentation of the flyway, I did not find a way to do this configuration. Here on StackOverflow some users say that only is necessary put the log4j on classpath and it should work. I tried put log4j files but does not work for me, however when I tried put the files of SLF4J on lib directory of flyway (classpath): slf4j-api-1.7.21.jar slf4j-simple-1.7.21.jar simplelogger.properties. The output of flyway has changed inserting logging prefixes: C:

How to skip a specific migration with flyway?

无人久伴 提交于 2019-12-03 10:20:21
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 ? 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 # Assuming you applied 01.002 manually $ mvn flyway:migrate -Dflyway.target=01.001 Insert a row for the script you

production data migration patterns in continuous delivery

笑着哭i 提交于 2019-12-03 07:01:22
问题 What are relational database (and schema) migration patterns on production in continuous delivery? In many traditional developments the DBA arranges a big migration script out of the many smaller scripts created in the current release cycle. But in CD the developer may want to push the change now to production, not wait to compile them with other scripts. I know on rails-migration but to me it looks more reasonable to use raw sql scripts. I've also seen tools like flyway to manage migrations

Automatic generation of migration SQL for Flyway

为君一笑 提交于 2019-12-03 06:37:28
Is it possible for new Flyway migrations to be generated by JPA/Hibernate's automatic schema generation when a new model / field etc. are added via Java code. It would be useful to capture the auto-generated SQL and save it directly to a new Flyway migration, for review / editing / committing to a project repository. Thank you in advance for any assistance or enlightenment you can offer. Flyway doesn't have built-in support for diff, I use liquidbase within a maven spring boot project and changelogs can be created from JPA/hibernate changes by using: mvn liquibase:diff All of the options for

How to create a database with flyway?

妖精的绣舞 提交于 2019-12-02 21:08:58
Question: Is it possible to create a new DB in a migration script and then connect to it? How? My Scenario: I'm trying to use flyway in my Java project (RESTful application using Jersey2.4 + tomcat 7 + PostgreSQL 9.3.1 + EclipseLink) for managing the changes between different developers which are using git. I wrote my init script and ran it with: PGPASSWORD='123456' psql -U postgres -f migration/V1__initDB.sql and it worked fine. The problem is that I can't create new DB with my scripts. when I include the following line in my script: CREATE DATABASE my_database OWNER postgres ENCODING 'UTF8';

production data migration patterns in continuous delivery

♀尐吖头ヾ 提交于 2019-12-02 20:48:49
What are relational database (and schema) migration patterns on production in continuous delivery? In many traditional developments the DBA arranges a big migration script out of the many smaller scripts created in the current release cycle. But in CD the developer may want to push the change now to production, not wait to compile them with other scripts. I know on rails-migration but to me it looks more reasonable to use raw sql scripts. I've also seen tools like flyway to manage migrations but I have not read of many people using them in production. This is why I wonder what are the common

Flyway and liquibase together? [closed]

不想你离开。 提交于 2019-12-02 20:31:33
Closed . This question needs to be more focused. It is not currently accepting answers. Learn more . Want to improve this question? Update the question so it focuses on one problem only by editing this post . I've looked at both Liquibase and Flyway individually and on an individual comparison alone, Liquibase seems like the better tool for our needs. Some sources mention using both Liquibase and Flyway together. Liquibase seems to have everything Flyway has and more flexibility when it comes to rollbacks. The main advantage of just Flyway seems to be not having to use XML, but Liquibase

Flyway repair with Spring Boot

旧街凉风 提交于 2019-12-02 20:14:46
I don't quite understand what I am supposed to do when a migration fails using Flyway in a Spring Boot project. I activated Flyway by simply adding the Flyway dependency in my pom.xml . And everything works fine. My database scripts are migrated when I launch the Spring Boot app. But I had an error in one of my scripts and my last migration failed. Now when I try to migrate, there is a "Migration checksum mismatch". Normally, I would run mvn flyway:repair , but since I am using Spring Boot, I am not supposed to use the Flyway Maven plug-in. So what am I supposed to do? there are several ways

How to reference flyway.locations via application.properties on Liberty Profile using classpath:

巧了我就是萌 提交于 2019-12-02 14:49:20
问题 I have a SpringBoot application running on Liberty using flyway and working with filesystem: to reference the db/migration files locally. For our deployed environment I would prefer to keep the files inside of the generated war and not in a server folder and specified directly. When I try to use classpath:db/migration I get the following: 2017-06-21 13:50:20.494 INFO 2600 --- [ecutor-thread-3] o.f.core.internal.util.VersionPrinter : Flyway 4.2.0 by Boxfuse 2017-06-21 13:50:21.521 INFO 2600 --