X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FDeploymentHandler%2FHandlesVersionStorage.pm;h=9f8cfac4f1e12e81a3679257c1b058e874733348;hb=6e9a733d577c24ac4fe4569515fbf94fecf40f5c;hp=9bf7a0f22ddbcba5dd0cc88f2c538962f974139b;hpb=5228a963e60b0c085a6ce930f9ba9dc66215676c;p=dbsrgits%2FDBIx-Class-DeploymentHandler.git diff --git a/lib/DBIx/Class/DeploymentHandler/HandlesVersionStorage.pm b/lib/DBIx/Class/DeploymentHandler/HandlesVersionStorage.pm index 9bf7a0f..9f8cfac 100644 --- a/lib/DBIx/Class/DeploymentHandler/HandlesVersionStorage.pm +++ b/lib/DBIx/Class/DeploymentHandler/HandlesVersionStorage.pm @@ -1,34 +1,47 @@ package DBIx::Class::DeploymentHandler::HandlesVersionStorage; use Moose::Role; -requires 'database_version'; +# ABSTRACT: Interface for version storage methods + requires 'add_database_version'; +requires 'database_version'; requires 'delete_database_version'; requires 'version_storage_is_installed'; 1; +# vim: ts=2 sw=2 expandtab + __END__ -=method database_version +=head1 DESCRIPTION - my $db_version = $version_storage->database_version; +Typically VersionStorages will be implemented with a simple +DBIx::Class::Result. Take a look at the +L for examples of what you +might want to do in your own storage. =method add_database_version $dh->add_database_version({ version => '1.02', - ddl => $ddl # can be undef, - upgrade_sql => $sql # can be undef, + ddl => $ddl, # can be undef + upgrade_sql => $sql, # can be undef }); Store a new version into the version storage +=method database_version + + my $db_version = $version_storage->database_version + +Returns the most recently installed version in the database. + =method delete_database_version $dh->delete_database_version({ version => '1.02' }) -simply deletes given database version from the version storage +Deletes given database version from the version storage =method version_storage_is_installed @@ -37,5 +50,17 @@ simply deletes given database version from the version storage return true iff the version storage is installed. +=head1 KNOWN IMPLEMENTATIONS + +=over + +=item * + +L + +=item * + +L + +=back -vim: ts=2 sw=2 expandtab