1 package DBIx::Class::DeploymentHandler::VersionStorage::Deprecated;
3 use DBIx::Class::DeploymentHandler::LogImporter ':log';
6 # ABSTRACT: (DEPRECATED) Use this if you are stuck in the past
14 isa => 'DBIx::Class::ResultSet',
16 builder => '_build_version_rs',
17 handles => [qw( database_version version_storage_is_installed )],
20 with 'DBIx::Class::DeploymentHandler::HandlesVersionStorage';
22 use DBIx::Class::DeploymentHandler::VersionStorage::Deprecated::VersionResult;
23 sub _build_version_rs {
24 $_[0]->schema->register_class(
25 dbix_class_schema_versions =>
26 'DBIx::Class::DeploymentHandler::VersionStorage::Deprecated::VersionResult'
28 $_[0]->schema->resultset('dbix_class_schema_versions')
31 sub add_database_version {
32 # deprecated doesn't support ddl or upgrade_ddl
33 my $version = $_[1]->{version};
34 log_debug { "Adding database version $version" };
35 $_[0]->version_rs->create({ version => $version })
38 sub delete_database_version {
39 my $version = $_[1]->{version};
40 log_debug { "Deleting database version $version" };
41 $_[0]->version_rs->search({ version => $version})->delete
44 __PACKAGE__->meta->make_immutable;
48 # vim: ts=2 sw=2 expandtab
54 I begrudgingly made this module (and other related modules) to keep porting
55 from L<DBIx::Class::Schema::Versioned> relatively simple. I will make changes
56 to ensure that it works with output from L<DBIx::Class::Schema::Versioned> etc,
57 but I will not add any new features to it.
59 Once I hit major version 1 usage of this module will emit a warning.
60 On version 2 it will be removed entirely.
64 Here's how to convert from that crufty old Deprecated VersionStorage to a shiny
65 new Standard VersionStorage:
67 my $s = My::Schema->connect(...);
68 my $dh = DeploymentHandler({
72 $dh->prepare_version_storage_install;
73 $dh->install_version_storage;
75 my @versions = $s->{vschema}->resultset('Table')->search(undef, {
76 order_by => 'installed',
77 })->get_column('version')->all;
79 $dh->version_storage->add_database_vesion({ version => $_ })
84 This class is an implementation of
85 L<DBIx::Class::DeploymentHandler::HandlesVersionStorage>. Pretty much all the
86 documentation is there.