use Moose;
use Method::Signatures::Simple;
-has schema => (
- isa => 'DBIx::Class::Schema',
- is => 'ro',
- required => 1,
- handles => [qw( ddl_filename schema_version )],
-);
+with 'DBIx::Class::DeploymentHandler::HandlesVersioning';
-has version_rs => (
- isa => 'DBIx::Class::ResultSet',
- is => 'ro',
- lazy_build => 1,
- handles => [qw( is_installed db_version )],
+has once => (
+ is => 'rw',
+ isa => 'Bool',
+ default => undef,
);
-method _build_version_rs {
- $self->schema->set_us_up_the_bomb;
- $self->schema->resultset('__VERSION')
-}
+sub next_version_set {
+ my $self = shift;
+ return undef
+ if $self->once;
-method ordered_schema_versions {
- ( $self->db_version, $self->schema_version)
+ $self->once(!$self->once);
+ return undef
+ if $self->db_version eq $self->to_version;
+ return [$self->db_version, $self->to_version];
}
+
__PACKAGE__->meta->make_immutable;
1;