MigrationVersion

A migration's version, ordered the way version numbers are ordered rather than the way text is.

1.9 comes before 1.10, which is the whole reason this is a type and not a String. Parts are held as Long, so a version written as a timestamp - 20260827120000, a convention plenty of projects use - counts as a number rather than overflowing into nonsense.

Missing parts are zero, so 1, 1.0 and 1.0.0 are one version, not three. They compare equal, they hash alike, and two migrations carrying them are a duplicate rather than a sequence. text keeps whichever of them was actually written; canonical is the spelling that goes into the history table.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The version with _ written as ., which is what goes in the history table and in a report.

Link copied to clipboard

The version as it was written - 2_1 where it came off a class name, 1.0 where the file said so.

Functions

Link copied to clipboard
open operator override fun compareTo(other: MigrationVersion): Int
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String