为什么和何时使用Liquibase? [英] Why and when Liquibase?

查看:86
本文介绍了为什么和何时使用Liquibase?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在堆栈溢出时搜索此问题,但找不到与此相关的任何问题.
我是Liquibase的新手,想知道

I have tried to search this question on stack overflow but couldn't find any question for this.
I am new on Liquibase and wants to know

  • 为什么Liquibase?
  • 什么时候应该在项目中使用Liquibase?
  • Why Liquibase?
  • When exactly one should use Liquibase in the project?

我知道这是要将所有数据库更改保存在一个地方,但是可以通过在某个存储库系统中创建一个简单的SQL文件并随时间进行更新来完成类似的操作.

I know that this is to keep all database changes in one place but the similar can be done by creating a simple SQL files in some repository system and keep updating it with time.

推荐答案

自管理模式创建文件和Liquibase(或其他

The key differentiator between a self-managed schema create file and Liquibase (or other schema migration tools) is that the latter provides a schema changelog. This is a record of the schema changes over time. It allows the database designer to specify changes in schema & enables programmatic upgrade or downgrade of the schema on demand.

还有其他好处,例如:

  • 数据库供应商的独立性(这是有问题的,但是他们会尝试)
  • 自动化文档
  • 数据库架构差异

另一种工具是 flyway .

您将在需要或需要自动管理模式更新而不会丢失数据时选择使用模式迁移工具.也就是说,您希望在将系统部署到长期存在的环境(例如客户站点或稳定的测试环境)之后,架构会发生变化.

You would choose to use a schema migration tool when you want or need to automatically manage schema updates without losing data. That is, you expect the schema to change after your system has been deployed to a long-lived environment such as a customer site or stable test environment.

这篇关于为什么和何时使用Liquibase?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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