flyway/liquibase如何处理服务中的破坏性升级? [英] How does flyway / liquibase handle destructive upgrades in service?

查看:127
本文介绍了flyway/liquibase如何处理服务中的破坏性升级?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

基于我对flyway/liquibase的理解,它们提供了通过预先配置的脚本(SQL查询,Java文件等)执行数据库升级的方法.但是我对以下内容不是很清楚:

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 :

  1. 如果进行破坏性升级会发生什么.

  1. What happens if there is destructive upgrade.

我有一个用例,例如将bigint列(包含数据)更改为日期类型.如果我尝试直接更改它,则最终将导致该列的数据损坏. flyway/liquibase如何处理此类升级?

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 ?

是否预先配置的脚本是让flyway/liquibase成为我的更改的唯一方法,还是有其他方法可以解决此问题.如果还有其他方法,它将以查询的形式输出diff吗?

Whether pre configured scripts are the only way to say flyway/liquibase that these are my changes or is there any other way for that matter. If there is some other way, will it output the diff in the form of queries ?

如果有人对以上内容有所了解,将会非常有帮助.

It will be very much helpful if someone shed light on the above.

推荐答案

从Flyway的角度来讲,它从一开始就由sql和java支持构建.如何使用这两种方法之一迁移数据库是您的责任. Flyway会照您说的做.

Speaking from Flyway's perspective, it was built with sql and java support from the start. How you migrate your db using either of these is your responsibility. Flyway will do as you tell it.

这篇关于flyway/liquibase如何处理服务中的破坏性升级?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆