--- /dev/null
+package DBIx::Class::DeploymentHandler::HandlesVersionStorage;
+use Moose::Role;
+
+requires 'database_version';
+requires 'add_database_version';
+requires 'install_version_storage';
+requires 'version_storage_is_installed';
+
+1;
+
+__END__
+
+vim: ts=2 sw=2 expandtab
--- /dev/null
+package DBIx::Class::DeploymentHandler::VersionStorage::Standard;
+use Moose;
+use Method::Signatures::Simple;
+
+has schema => (
+ isa => 'DBIx::Class::Schema',
+ is => 'ro',
+ required => 1,
+);
+
+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
+ 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')
+}
+
+sub add_database_version { $_[0]->version_rs->create($_[1]) }
+
+sub install_version_storage { die }
+
+1;
+
+__END__
+
+vim: ts=2 sw=2 expandtab
--- /dev/null
+package DBIx::Class::DeploymentHandler::WithStandardVersionStorage;
+use Moose::Role;
+
+use DBIx::Class::DeploymentHandler::VersionStorage::Standard;
+
+has version_storage => (
+ does => 'DBIx::Class::DeploymentHandler::HandlesVersionStorage',
+ is => 'ro',
+ lazy_build => 1,
+ handles => 'DBIx::Class::DeploymentHandler::HandlesVersionStorage',
+);
+
+sub _build_version_storage {
+ DBIx::Class::DeploymentHandler::VersionStorage::Standard
+ ->new({ schema => $_[0]->schema });
+}
+
+1;
+
+__END__
+
+vim: ts=2 sw=2 expandtab