MigrationVersion

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

1.9 comes before 1.10. Parts are held as Long, so a version written as a timestamp - 20260827120000 - fits.

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 . - a class name cannot hold one - which is what goes in the history table and in a report. Trailing zeroes stay as written; whether two versions are the same is settled by their parts, never by this string.

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