More doc
[dbsrgits/DBIx-Class-DeploymentHandler.git] / lib / DBIx / Class / DeploymentHandler / VersionStorage / Deprecated.pm
index 72ffb3c..f39460b 100644 (file)
@@ -31,10 +31,35 @@ sub add_database_version {
   $_[0]->version_rs->create({ version => $_[1]->{version} })
 }
 
+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
+=head1 THIS SUCKS
+
+Here's how to convert from that crufty old Deprecated VersionStorage to a shiny
+new Standard VersionStorage:
+
+ my $s  = My::Schema->connect(...);
+ my $dh = DeploymentHandler({
+   schema => $s,
+ });
+
+ $dh->prepare_version_storage_install;
+ $dh->install_version_storage;
+
+ my @versions = $s->{vschema}->resultset('Table')->search(undef, {
+   order_by => 'installed',
+ })->get_column('version')->all;
+
+ $dh->version_storage->add_database_vesion({ version => $_ })
+   for @versions;
+