X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FDeploymentHandler%2FHandlesVersioning.pm;h=495c8bba223b0a648c48a854f18ac5ed26432cac;hb=b0bf9d6bb319880c42e98b8b07a65d315da5cbfd;hp=7b111a272ddddd2f3689342e6092be6cd8ae7f60;hpb=24794769393e7e30c827e1010c5e23f7a9a58657;p=dbsrgits%2FDBIx-Class-DeploymentHandler.git diff --git a/lib/DBIx/Class/DeploymentHandler/HandlesVersioning.pm b/lib/DBIx/Class/DeploymentHandler/HandlesVersioning.pm index 7b111a2..495c8bb 100644 --- a/lib/DBIx/Class/DeploymentHandler/HandlesVersioning.pm +++ b/lib/DBIx/Class/DeploymentHandler/HandlesVersioning.pm @@ -1,37 +1,25 @@ package DBIx::Class::DeploymentHandler::HandlesVersioning; use Moose::Role; +# note: the sets returned need to match! requires 'next_version_set'; +requires 'previous_version_set'; -has schema => ( - isa => 'DBIx::Class::Schema', - is => 'ro', - required => 1, - handles => [qw( ddl_filename schema_version )], -); +1; -has version_rs => ( - isa => 'DBIx::Class::ResultSet', - is => 'ro', - lazy_build => 1, - handles => [qw( is_installed db_version )], -); +__END__ -sub _build_version_rs { - $_[0]->schema->set_us_up_the_bomb; - $_[0]->schema->resultset('__VERSION') -} +=method next_version_set -has to_version => ( - is => 'ro', - lazy_build => 1, -); + while (my $version_set = $versions->next_version_set) { + ... + } -sub _build_to_version { $_[0]->schema->schema_version } +=method previous_version_set -1; - -__END__ + while (my $version_set = $versions->previous_version_set) { + ... + } # normally a VersionHandler will take # a to_version and yeild an iterator of