1 package DBIx::Class::DeploymentHandler::VersionStorage::Deprecated;
4 # ABSTRACT: (DEPRECATED) Use this if you are stuck in the past
6 use Method::Signatures::Simple;
9 isa => 'DBIx::Class::Schema',
15 isa => 'DBIx::Class::ResultSet',
17 builder => '_build_version_rs',
18 handles => [qw( database_version version_storage_is_installed )],
21 with 'DBIx::Class::DeploymentHandler::HandlesVersionStorage';
23 use DBIx::Class::DeploymentHandler::VersionStorage::Deprecated::VersionResult;
24 sub _build_version_rs {
25 $_[0]->schema->register_class(
26 dbix_class_schema_versions =>
27 'DBIx::Class::DeploymentHandler::VersionStorage::Deprecated::VersionResult'
29 $_[0]->schema->resultset('dbix_class_schema_versions')
32 sub add_database_version {
33 # deprecated doesn't support ddl or upgrade_ddl
34 $_[0]->version_rs->create({ version => $_[1]->{version} })
37 sub delete_database_version {
38 $_[0]->version_rs->search({ version => $_[1]->{version}})->delete
41 __PACKAGE__->meta->make_immutable;
45 # vim: ts=2 sw=2 expandtab
51 I begrudgingly made this module (and other related modules) to keep porting
52 from L<DBIx::Class::Schema::Versioned> relatively simple. I will make changes
53 to ensure that it works with output from L<DBIx::Class::Schema::Versioned> etc,
54 but I will not add any new features to it.
56 Once I hit major version 1 usage of this module will emit a warning.
57 On version 2 it will be removed entirely.
61 Here's how to convert from that crufty old Deprecated VersionStorage to a shiny
62 new Standard VersionStorage:
64 my $s = My::Schema->connect(...);
65 my $dh = DeploymentHandler({
69 $dh->prepare_version_storage_install;
70 $dh->install_version_storage;
72 my @versions = $s->{vschema}->resultset('Table')->search(undef, {
73 order_by => 'installed',
74 })->get_column('version')->all;
76 $dh->version_storage->add_database_vesion({ version => $_ })