https://flywaydb.org/getstarted/why

First, let's start from the beginning and assume we have a project called Shiny

and its primary deliverable is a piece of software called Shiny Soft that connects to a database called Shiny DB.

一个叫做Shiny的项目,有软件还有数据库

The simplest diagram to represent this could look something like this:

We have our software and our database. Great. And this could very well be all you need.

But on most projects, this simple view of the world very quickly translates into this:

We now not only have to deal with one copy of our environment, but with several. This presents a number of challenges.

We have been pretty good at solving them on the code side.

  • Version control is now universal with better tools everyday.
  • We have reproducible builds and continuous integration.
  • We have well defined release and deployment processes.

But what about the database?

Well unfortunately we have not been doing so well there.

Many projects still rely on manually applied sql scripts.

And sometimes not even that (a quick sql statement here or there to fix a problem). And soon many questions arise:

  • What state is the database in on this machine?
  • Has this script already been applied or not?
  • Has the quick fix in production been applied in test afterwards?
  • How do you set up a new database instance?

More often than not the answer to these questions is: We don't know.

Database migrations are a great way to regain恢复 control of this mess.

They allow you to:

  • Recreate a database from scratch
  • Make it clear at all times what state a database is in
  • Migrate in a deterministic way from your current version of the database to a newer one

Why database migrations?的更多相关文章

  1. EntityFramework 7 Migrations 迁移命令

    示例代码: using Microsoft.Data.Entity; using System.Collections.Generic; namespace ClassLibrary1 { publi ...

  2. Laravel 5 基础(六)- 数据库迁移(Migrations)

    database migrations 是laravel最强大的功能之一.数据库迁移可以理解为数据库的版本控制器. 在 database/migrations 目录中包含两个迁移文件,一个建立用户表, ...

  3. EF5&MVC4 学习1、创建新的Contoso University Application,并创建Model Class 生成对应的database

    参考:http://www.asp.net/mvc/tutorials/getting-started-with-ef-5-using-mvc-4/creating-an-entity-framewo ...

  4. DB Migrations更新数据库命令

    在项目迭代的过程中,数据库结构常常需要跟随业务需求的变化做出调整,尤其在迭代的初期阶段,加一个字段减一个字段的需求更是家常便饭.在小型团队中,往往是负责开发功能模块的程序员在完成本地开发环境数据库的变 ...

  5. .NET中使用Redis (二)

    很久以前写了一篇文章 .NET中使用Redis 介绍了如何安装Redis服务端,以及如何在.NET中调用Redis读取数据.本文简单介绍如何设计NoSQL数据库,以及如何使用Redis来存储对象. 和 ...

  6. ABP(现代ASP.NET样板开发框架)系列之2、ABP入门教程

    点这里进入ABP系列文章总目录 基于DDD的现代ASP.NET开发框架--ABP系列之2.ABP入门教程 ABP是“ASP.NET Boilerplate Project (ASP.NET样板项目)” ...

  7. Laravel学习--关于Relation的坑

    前段时间比较忙,就没有坚持写博客,但发现这周末再想捡起来,好难,一直到了今天晚上,才决定坐下来写一篇,哈哈哈-- 最近在用 Laravel 5.2,踩了几个关于 Relation 的坑,在这里用博客记 ...

  8. Laravel大型项目系列教程(一)

    Laravel大型项目系列教程(一) 一.课程概述 1.课程介绍 本教程将使用Laravel完成一个多用户的博客系统,大概会包含如下内容: 路由管理. 用户管理,如用户注册.修改信息.锁定用户等. 文 ...

  9. 用lumen构建API的相关流程

    概述 Lumen是一个基于Laravel的微框架,主要用于小型应用和微服务,专注于性能和速度的优化,该框架一个重要的应用就是构建 RESTAPI. 为什么用Lumen构建REST API Lumen访 ...

随机推荐

  1. 学习笔记<3>View接触

    一.View基本概念 1.界面上显示所有的控件都是用对象表示的,即有类,这些类都是View的子类. 2.View的种类 二.在Activity当中获取代表View的对象 1.根据ID可以用方法获取到对 ...

  2. Lua用一维数组存储一个n阶方阵,输出这个方阵的正对角线上的数的和与反对角线上的数的和的差的绝对值。

    arr = {, , , , , , , , -} function diagonalDifference(arr) dimesion = math.sqrt(#arr) arr1 = {} sum1 ...

  3. Vue系列之 => 组件中的data和methods

    使用data <!DOCTYPE html> <html lang="en"> <head> <meta charset="UT ...

  4. Maven的特点、优点-功能摘要

    Maven功能摘要 以下是Maven的主要特点: 遵循最佳实践的简单项目设置 - 在几秒钟内启动新项目或模块 所有项目的一致使用 - 意味着新开发人员进入项目的时间不会增加 卓越的依赖管理,包括自动更 ...

  5. Spark学习之路 (五)Spark伪分布式安装

    一.JDK的安装 JDK使用root用户安装 1.1 上传安装包并解压 [root@hadoop1 soft]# tar -zxvf jdk-8u73-linux-x64.tar.gz -C /usr ...

  6. JavaScript 函数声明与函数表达式的区别 函数声明提升(function declaration hoisting)

    解析器在向执行环境中加载数据时,对函数声明和函数表达式并非一视同仁.解析器会率先读取函数声明,并使其在执行任何代码之前可用(可以访问).至于函数表达式,则必须等到解析器执行到它所在的代码行,才会真的被 ...

  7. SLAM学习笔记 - ORB_SLAM2源码运行及分析

    参考资料: DBow2的理解 单目跑TUM数据集的运行和函数调用过程 跑数据集不需要ros和相机标定,进入ORB_SLAM目录,执行以下命令: ./Examples/Monocluar/mono_tu ...

  8. mysql 问题:wait_timeout

    1,show global variables like 'wait_timeout'; 查询'wait_timeout' 默认是8天即28800秒 2,修改 windows 安装目录下的my.ini ...

  9. springboot报错Whitelabel Error Page

    第一次使用springboot没有问题.隔了两天继续看.一直报错Whitelabel Error Page. 重新搭建试了任何方法都错了. 报的就是一个404错误,犯了一个习惯性错误,一般都是loca ...

  10. 量化交易-外汇交易-MetaTrader5

    量化交易-外汇交易-MetaTrader5 外汇有充足的流动性, 7*24, 交易成本低,多空双向,外加杠杆,无人能控盘,有模拟盘,相当适合做量化交易练习积累经验. 第一,全球最大最公平的市场.外汇市 ...