X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FDeploymentHandler%2FVersionStorage%2FStandard.pm;h=2151714628ca89bf10b0c1820e83f2edfa9b8503;hb=e52174e31b95fe335f6ab8cfdbf23cc2a0c05673;hp=c286ffec1ba5fe3ad7715015292e188cb3bce4a9;hpb=ee82cb0e76144914d520f60f7369448c188e2fe1;p=dbsrgits%2FDBIx-Class-DeploymentHandler.git diff --git a/lib/DBIx/Class/DeploymentHandler/VersionStorage/Standard.pm b/lib/DBIx/Class/DeploymentHandler/VersionStorage/Standard.pm index c286ffe..2151714 100644 --- a/lib/DBIx/Class/DeploymentHandler/VersionStorage/Standard.pm +++ b/lib/DBIx/Class/DeploymentHandler/VersionStorage/Standard.pm @@ -11,22 +11,31 @@ has schema => ( has version_rs => ( isa => 'DBIx::Class::ResultSet', is => 'ro', - lazy_build => 1, # builder comes from another role... - # which is... probably not how we want it + lazy_build => 1, handles => [qw( database_version version_storage_is_installed )], ); with 'DBIx::Class::DeploymentHandler::HandlesVersionStorage'; sub _build_version_rs { - $_[0]->schema->set_us_up_the_bomb; - $_[0]->schema->resultset('__VERSION') + $_[0]->schema->register_class( + __VERSION => + 'DBIx::Class::DeploymentHandler::VersionStorage::Standard::VersionResult' + ); + $_[0]->schema->resultset('__VERSION') } sub add_database_version { $_[0]->version_rs->create($_[1]) } +sub delete_database_version { + $_[0]->version_rs->search({ version => $_[1]->{version}})->delete +} + +__PACKAGE__->meta->make_immutable; + 1; +# vim: ts=2 sw=2 expandtab + __END__ -vim: ts=2 sw=2 expandtab