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. JavaIO详解

    很全面的内容:http://www.cnblogs.com/rollenholt/archive/2011/09/11/2173787.html

  2. salt更换新key

    1  停止salt-minion服务 service salt-minion stop 2 删除salt-minion公钥文件 rm /etc/salt/pki/minion/minion.pub r ...

  3. ios 的ASIHTTPRequest学习

    发起一个同步请求 同步意为着线程阻塞,在主线程中使用此方法会使应用Hang住而不响应任何用户事件.所以,在应用程序设计时,大多被用在专门的子线程增加用户体验,或用异步请求代替(下面会讲到). - (I ...

  4. postgresql架构基础(转)-(1)

    PostgreSQL使用一种客户端/服务器的模型.一次PostgreSQL会话由下列相关的进程(程序)组成: 一个服务器进程,它管理数据库文件.接受来自客户端应用与数据库的联接并且代表客户端在数据库上 ...

  5. ebay商品基本属性组合成数据表格式,可用上传到系统递交数据

    该刊登表设计是利用VB写的,当时因为两个系统的数据不能直接对接,又copy并且组合SKU,一个表格一个表格填写,比较麻烦,还好刊登系统可以允许用excel表格上传数据 所以就下好模板,学了VB语言,在 ...

  6. Git Bash关键命令

    1.默认目录是C:\Users\用户名 2.切换目录:$cd c:\\windows 3.切换到上级目录:cd ..,中间有空格 4.列出某目录所有文件,相当于DOS下的dir:ls c:\\wind ...

  7. 转!!git如何撤销上一次commit(或已push)

    原博文地址 : https://www.cnblogs.com/lyy-2016/p/6509707.html git如何撤销上一次commit操作 1.第一种情况:还没有push,只是在本地comm ...

  8. Day02 html回顾和CSS介绍

    昨天内容回顾     1.html的操作思想         ** 使用标签把要操作的数据包起来,通过修改标签的属性值来实现标签内数据样式的变化         *** <font size=& ...

  9. Java系列介绍

    Java系列目录 重新编写equals()方法,hashCode()方法,以及toString(),提供自定义的相等标准,以及自描述函数 Java 7新增功能 Java应用程序中System.out. ...

  10. sqlserver三种分页方式性能比较

    Liwu_Items表,CreateTime列建立聚集索引 第一种,sqlserver2005特有的分页语法 declare @page intdeclare @pagesize intset @pa ...