1 package DBIx::Class::DeploymentHandler::VersionHandler::DatabaseToSchemaVersions;
3 use Sub::Quote 'quote_sub';
4 use MooX::Types::MooseLike::Base qw(Str Bool);
6 # ABSTRACT: Go straight from Database to Schema version
8 with 'DBIx::Class::DeploymentHandler::HandlesVersioning';
10 has schema_version => (
16 has database_version => (
22 has to_version => ( # configuration
25 builder => '_build_to_version',
28 sub _build_to_version { $_[0]->schema_version }
33 default => quote_sub(q{undef}),
36 sub next_version_set {
41 $self->once(!$self->once);
43 if $self->database_version eq $self->to_version;
44 return [$self->database_version, $self->to_version];
47 sub previous_version_set {
52 $self->once(!$self->once);
54 if $self->database_version eq $self->to_version;
55 return [$self->database_version, $self->to_version];
60 # vim: ts=2 sw=2 expandtab
66 This class is an implementation of
67 L<DBIx::Class::DeploymentHandler::HandlesVersioning>. Pretty much all the
68 documentation is there.