1 package DBIx::Class::DeploymentHandler::VersionHandler::Monotonic;
5 with 'DBIx::Class::DeploymentHandler::HandlesVersioning';
7 has schema_version => (
13 has database_version => (
25 sub _build_to_version { $_[0]->schema_version }
34 croak "you are trying to upgrade and your current version is greater\n".
35 "than the version you are trying to upgrade to. Either downgrade\n".
36 "or update your schema" if $_[0]->to_version < $_[0]->_version;
39 sub _inc_version { $_[0]->_version($_[0]->_version + 1 ) }
40 sub _dec_version { $_[0]->_version($_[0]->_version - 1 ) }
42 sub _build__version { $_[0]->database_version }
44 sub previous_version_set {
47 if $self->to_version == $self->_version;
50 return [$self->_version, $self->_version + 1];
53 sub next_version_set {
56 if $self->to_version == $self->_version;
59 return [$self->_version - 1, $self->_version];
62 __PACKAGE__->meta->make_immutable;
68 vim: ts=2 sw=2 expandtab