1 package DBIx::Class::DeploymentHandler::VersionStorage::Deprecated;
3 use DBIx::Class::DeploymentHandler::Logger;
4 use Log::Contextual ':log', -package_logger =>
5 DBIx::Class::DeploymentHandler::Logger->new({
10 # ABSTRACT: (DEPRECATED) Use this if you are stuck in the past
18 isa => 'DBIx::Class::ResultSet',
20 builder => '_build_version_rs',
21 handles => [qw( database_version version_storage_is_installed )],
24 with 'DBIx::Class::DeploymentHandler::HandlesVersionStorage';
26 use DBIx::Class::DeploymentHandler::VersionStorage::Deprecated::VersionResult;
27 sub _build_version_rs {
28 $_[0]->schema->register_class(
29 dbix_class_schema_versions =>
30 'DBIx::Class::DeploymentHandler::VersionStorage::Deprecated::VersionResult'
32 $_[0]->schema->resultset('dbix_class_schema_versions')
35 sub add_database_version {
36 # deprecated doesn't support ddl or upgrade_ddl
37 my $version = $_[1]->{version};
38 log_debug { "Adding database version $version" };
39 $_[0]->version_rs->create({ version => $version })
42 sub delete_database_version {
43 my $version = $_[1]->{version};
44 log_debug { "Deleting database version $version" };
45 $_[0]->version_rs->search({ version => $version})->delete
48 __PACKAGE__->meta->make_immutable;
52 # vim: ts=2 sw=2 expandtab
58 I begrudgingly made this module (and other related modules) to keep porting
59 from L<DBIx::Class::Schema::Versioned> relatively simple. I will make changes
60 to ensure that it works with output from L<DBIx::Class::Schema::Versioned> etc,
61 but I will not add any new features to it.
63 Once I hit major version 1 usage of this module will emit a warning.
64 On version 2 it will be removed entirely.
68 Here's how to convert from that crufty old Deprecated VersionStorage to a shiny
69 new Standard VersionStorage:
71 my $s = My::Schema->connect(...);
72 my $dh = DeploymentHandler({
76 $dh->prepare_version_storage_install;
77 $dh->install_version_storage;
79 my @versions = $s->{vschema}->resultset('Table')->search(undef, {
80 order_by => 'installed',
81 })->get_column('version')->all;
83 $dh->version_storage->add_database_vesion({ version => $_ })
88 This class is an implementation of
89 L<DBIx::Class::DeploymentHandler::HandlesVersionStorage>. Pretty much all the
90 documentation is there.