FAQ Flyway

https://flywaydb.org/documentation/faq

What is the best strategy for dealing with hot fixes?

You have a regular release schedule, say once per sprint. Version 7 is live and you are developing version 8. Version 8 contains DB Schema Changes. Suddenly hot fix is required for version 7, and it also needs a schema change.

How can you deal with this?

Even though the code may be branched, the database schema won't. It will have a linear evolution.

This means that the emergency fix, say version 7.1 needs to be deployed as part of the hot fix AND the new version 8.

By the time等到 version 8 will be deployed, Flyway will recognize that the migration version 7.1 has already be applied. It will ignore it and migrate to version 8.

When recreating the database, everything with be cleanly installed in order: version 7, 7.1 and 8.

If this isn't an option you can activate the outOfOrder property to allow Flyway to run the migrations out of order and fill the gaps.

 

Can I make structure changes to the DB outside of Flyway?

No. One of the prerequisites for being able to rely on the metadata in the database and having reliable migrations is that ALL database changes are made by Flyway. No exceptions. The price for this reliability is discipline纪律. Ad hoc 特别的changes have no room here as they will literally sabotage妨害 your confidence. Even simple things like adding an index can trip over a migration if it has already been added manually before.

 

How do you repair the database after a failed migration?

If your database supports DDL transactions, Flyway does the work for you.

If your database doesn't, these are the steps to follow:

  1. Manually undo the changes of the migration
  2. Invoke the repair command
  3. Fix the failed migration
  4. Try again

 

Why is the flyway_schema_history table case-sensitive?

The flyway_schema_history is case-sensitive due to the quotes used in its creation script. This allows for characters not supported in identifiers otherwise.

The name (and case) can be configured through the flyway.table property.

The table is an internal Flyway implementation detail and not part of the a public API. It can therefore change from time to time.

 

作者:Chuck Lu    GitHub    
posted @   ChuckLu  阅读(308)  评论(0编辑  收藏  举报
编辑推荐:
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
历史上的今天:
2018-03-15 null in JavaScript
2017-03-15 查看计算机型号
2016-03-15 ConfigurationManager.AppSettings Property
2016-03-15 What is a good buffer size for socket programming?
2016-03-15 Protected vs protected internal (Again) in c#
2016-03-15 protected (C# Reference)
2016-03-15 abstract (C# Reference)
点击右上角即可分享
微信分享提示