NAME

DBIO::DeploymentHandler::VersionHandler::Monotonic - Obvious version progressions

VERSION

version 0.900004

DESCRIPTION

Version handler for integer versions that move one step at a time. It keeps a cursor that starts at "initial_version" and walks towards "to_version". Implements DBIO::DeploymentHandler::HandlesVersioning.

ATTRIBUTES

schema_version

The version the code declares, as given to "new".

initial_version

The version the cursor starts from.

to_version

The target version, numified if given as a version object; defaults to "schema_version".

METHODS

new

my $vh = DBIO::DeploymentHandler::VersionHandler::Monotonic->new({
  schema_version  => 3,
  initial_version => 1,   # or database_version => 1
  to_version      => 3,
});

Takes a hashref or a flat list and keeps every key; database_version is accepted as an alias for initial_version.

previous_version_set

Returns [$v, $v - 1] for the current cursor $v and moves the cursor down by one, or undef once the cursor has reached "to_version". Croaks if "to_version" is above the cursor.

next_version_set

Returns [$v, $v + 1] for the current cursor $v and moves the cursor up by one, or undef once the cursor has reached "to_version". Croaks if "to_version" is below the cursor.

AUTHOR

DBIO & DBIx::Class Authors

COPYRIGHT AND LICENSE

Copyright (C) 2026 DBIO Authors Portions Copyright (C) 2005-2025 DBIx::Class Authors Based on DBIx::Class, heavily modified.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.