https://stackoverflow.com/questions/19984397/how-does-flyway-sort-version-numbers

In one word: numerically. As would be expected for a number.

https://flywaydb.org/documentation/migrations#versioned-migrations

Versioned Migrations

The most common type of migration is a versioned migration. Each versioned migration has a version, a description and a checksum. The version must be unique. The description is purely informative for you to be able to remember what each migration does. The checksum is there to detect accidental changes. Versioned migrations are applied in order exactly once.

Versioned migrations are typically used for:

  • Creating/altering/dropping tables/indexes/foreign keys/enums/UDTs/…
  • Reference data updates
  • User data corrections

Here is a small example:

CREATE TABLE car (
id INT NOT NULL PRIMARY KEY,
license_plate VARCHAR NOT NULL,
color VARCHAR NOT NULL
); ALTER TABLE owner ADD driver_license_id VARCHAR; INSERT INTO brand (name) VALUES ('DeLorean');

Each versioned migration must be assigned a unique version. Any version is valid as long as it conforms to the usual dotted notation. For most cases a simple increasing integer should be all you need. However Flyway is quite flexible and all these versions are valid versioned migration versions:

  • 1
  • 001
  • 5.2
  • 1.2.3.4.5.6.7.8.9
  • 205.68
  • 20130115113556
  • 2013.1.15.11.35.56
  • 2013.01.15.11.35.56

Versioned migrations are applied in the order of their versions. Versions are sorted numerically as you would normally expect.

How does flyway sort version numbers?的更多相关文章

  1. [LeetCode] Compare Version Numbers 版本比较

    Compare two version numbers version1 and version1.If version1 > version2 return 1, if version1 &l ...

  2. 【leetcode】Compare Version Numbers

    题目描述: Compare two version numbers version1 and version2. If version1 > version2 return 1, if vers ...

  3. Compare Version Numbers

    Compare two version numbers version1 and version1. If version1 > version2 return 1, if version1 & ...

  4. 【leetcode】Compare Version Numbers(middle)

    Compare two version numbers version1 and version2.If version1 > version2 return 1, if version1 &l ...

  5. ✡ leetcode 165. Compare Version Numbers 比较两个字符串数字的大小 --------- java

    Compare two version numbers version1 and version2.If version1 > version2 return 1, if version1 &l ...

  6. Java for LeetCode 165 Compare Version Numbers

    Compare two version numbers version1 and version2.If version1 > version2 return 1, if version1 &l ...

  7. LeetCode Compare Version Numbers

    原题链接在这里:https://leetcode.com/problems/compare-version-numbers/ 用string.split()方法把原有string 从小数点拆成 str ...

  8. leetcode:Compare Version Numbers

    Compare two version numbers version1 and version2.If version1 > version2 return 1, if version1 &l ...

  9. 【LeetCode】165 - Compare Version Numbers

    Compare two version numbers version1 and version2.If version1 > version2 return 1, if version1 &l ...

随机推荐

  1. 从TCP三次握手说起–浅析TCP协议中的疑难杂症(2)

    版权声明:本文由黄日成原创文章,转载请注明出处: 文章原文链接:https://www.qcloud.com/community/article/108 来源:腾云阁 https://www.qclo ...

  2. sencha touch 入门系列 (七)sencha touch 类系统讲解(上)

    在mvc结构的基础上,sencha touch又使用了sencha公司为extjs4开发出来的类系统,在面向对象的编程语言中,类是对对象的定义,它描述了对象所包含的大量属性和方法. 跟面向对象语言类似 ...

  3. ShowDoc 搭建 (未成功....)

    官方教程:https://www.showdoc.cc/help?page_id=13732 下载了showdoc,服务器映射本地磁盘的时候,服务器用户名和密码忘了... 远程服务器用户名和密码修改 ...

  4. 【BZOJ2251】[2010Beijing Wc]外星联络 后缀数组

    [BZOJ2251][2010Beijing Wc]外星联络 Description 小 P 在看过电影<超时空接触>(Contact)之后被深深的打动,决心致力于寻找外星人的事业.于是, ...

  5. [Music] Billboard Hot 100 Singles Chart 27th Jun 2015

    01 Wiz Khalifa - See You Again (Feat. Charlie P..> 30-Jul-2015 09:12 9247814 02 Taylor Swift - Ba ...

  6. log4net类库配置、WebService配置

    一.类库配置 结构如下图 1.LogUtility类 public class LogUtility { private static readonly log4net.ILog log = log4 ...

  7. 精简的webservice

    看了网上好多关于webservice的例子,基本上对初学者来说都是模棱两可云里雾里,现在,我将网上关于webservice的讲解提炼出来,通过一个最简单使用并且方便的例子,告诉大家什么是webserv ...

  8. ajax初级知识(转载)

    1.什么是ajax? Ajax 是 Asynchronous JavaScript and XML(以及 DHTML 等)的缩写. 2.ajax需要什么基础? HTML 用于建立 Web 表单并确定应 ...

  9. 【MySQL】为什么不要问我DB极限QPS/TPS

    为什么不要问我DB极限QPS/TPS 背景 相信很多开发都会有这个疑问,DB到底可以支撑多大的业务量,如何去评估?对于这个很专业的问题,DBA也没有办法直接告诉你,更多的都是靠经验提供一个看似靠谱的结 ...

  10. LightGBM值参数配置

    LightGBM 可以使用一个 pairs 的 list 或一个字典来设置参数: 1.Booster提升器的参数: param={'num_class':33, 'boosting_type':'gb ...