Commit | Line | Data |
01342998 |
1 | package DBIx::Class::DeploymentHandler::Deprecated; |
2 | |
9deabd1f |
3 | # ABSTRACT: (DEPRECATED) Use this if you are stuck in the past |
4 | |
01342998 |
5 | use Moose; |
6 | use Moose::Util 'apply_all_roles'; |
7 | |
8 | extends 'DBIx::Class::DeploymentHandler::Dad'; |
a976d6e4 |
9 | use DBIx::Class::DeploymentHandler::WithApplicatorDumple2; |
41219a5d |
10 | # a single with would be better, but we can't do that |
11 | # see: http://rt.cpan.org/Public/Bug/Display.html?id=46347 |
a976d6e4 |
12 | with WithApplicatorDumple2( |
1b7ebcbf |
13 | interface_role => 'DBIx::Class::DeploymentHandler::HandlesDeploy', |
14 | class_name => 'DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator::Deprecated', |
15 | delegate_name => 'deploy_method', |
16 | attributes_to_assume => ['schema'], |
91adde75 |
17 | attributes_to_copy => [qw( script_directory databases sql_translator_args )], |
a976d6e4 |
18 | ), |
19 | WithApplicatorDumple2( |
1b7ebcbf |
20 | interface_role => 'DBIx::Class::DeploymentHandler::HandlesVersionStorage', |
21 | class_name => 'DBIx::Class::DeploymentHandler::VersionStorage::Deprecated', |
22 | delegate_name => 'version_storage', |
23 | attributes_to_assume => ['schema'], |
a976d6e4 |
24 | ); |
41219a5d |
25 | with 'DBIx::Class::DeploymentHandler::WithReasonableDefaults'; |
01342998 |
26 | |
27 | sub BUILD { |
28 | my $self = shift; |
29 | |
fe3b6dff |
30 | if ($self->schema->can('ordered_versions') && $self->schema->ordered_versions) { |
01342998 |
31 | apply_all_roles( |
32 | $self, |
a976d6e4 |
33 | WithApplicatorDumple2( |
1b7ebcbf |
34 | interface_role => 'DBIx::Class::DeploymentHandler::HandlesVersioning', |
35 | class_name => 'DBIx::Class::DeploymentHandler::VersionHandler::ExplicitVersions', |
36 | delegate_name => 'version_handler', |
37 | attributes_to_assume => [qw( database_version schema_version to_version )], |
a976d6e4 |
38 | ) |
01342998 |
39 | ); |
40 | } else { |
41 | apply_all_roles( |
42 | $self, |
a976d6e4 |
43 | WithApplicatorDumple2( |
1b7ebcbf |
44 | interface_role => 'DBIx::Class::DeploymentHandler::HandlesVersioning', |
45 | class_name => 'DBIx::Class::DeploymentHandler::VersionHandler::DatabaseToSchemaVersions', |
46 | delegate_name => 'version_handler', |
47 | attributes_to_assume => [qw( database_version schema_version to_version )], |
a976d6e4 |
48 | ) |
01342998 |
49 | ); |
50 | } |
1b7ebcbf |
51 | # the following is just a hack so that ->version_storage |
52 | # won't be lazy |
53 | $self->version_storage; |
01342998 |
54 | } |
55 | |
56 | __PACKAGE__->meta->make_immutable; |
57 | |
58 | 1; |
59 | |
e52174e3 |
60 | # vim: ts=2 sw=2 expandtab |
61 | |
01342998 |
62 | __END__ |
63 | |
bcc72297 |
64 | =head1 DEPRECATED |
e52174e3 |
65 | |
bcc72297 |
66 | I begrudgingly made this module (and other related modules) to make porting |
67 | from L<DBIx::Class::Schema::Versioned> relatively simple. I will make changes |
68 | to ensure that it works with output from L<DBIx::Class::Schema::Versioned> etc, |
69 | but I will not add any new features to it. It already lacks numerous features |
70 | that the full version provides in style: |
71 | |
72 | =over |
73 | |
74 | =item * |
75 | |
76 | Downgrades |
77 | |
78 | =item * |
79 | |
80 | Multiple files for migrations |
81 | |
82 | =item * |
83 | |
84 | Perl files in migrations |
85 | |
86 | =item * |
87 | |
88 | Shared Perl/SQL for different databases |
89 | |
90 | =back |
91 | |
92 | And there's probably more. |
93 | |
94 | At version 1.000000 usage of this module will emit a warning. At version |
95 | 2.000000 it will be removed entirely. |
96 | |
97 | To migrate to the New Hotness take a look at: |
98 | L<DBIx::Class::DeploymentHandler::VersionStorage::Deprecated/THIS SUCKS> and |
99 | L<DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator::Deprecated/THIS SUCKS>. |
100 | |
101 | =head1 SYNOPSIS |
102 | |
103 | Look at L<DBIx::Class::DeploymentHandler/SYNPOSIS>. I won't repeat |
104 | it here to emphasize, yet again, that this should not be used unless you really |
105 | want to live in the past. |
106 | |
107 | =head1 WHERE IS ALL THE DOC?! |
108 | |
109 | C<DBIx::Class::DeploymentHandler::Deprecated> extends |
110 | L<DBIx::Class::DeploymentHandler::Dad>, so that's probably the first place to |
111 | look when you are trying to figure out how everything works. |
112 | |
961d42b1 |
113 | Next would be to look at all the pieces that fill in the blanks that |
bcc72297 |
114 | L<DBIx::Class::DeploymentHandler::Dad> expects to be filled. They would be |
61627cf0 |
115 | L<DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator::Deprecated>, |
116 | L<DBIx::Class::DeploymentHandler::VersionStorage::Deprecated>, and |
bcc72297 |
117 | L<DBIx::Class::DeploymentHandler::WithReasonableDefaults>. Also, this class |
118 | is special in that it applies either |
61627cf0 |
119 | L<DBIx::Class::DeploymentHandler::VersionHandler::ExplicitVersions> or |
120 | L<DBIx::Class::DeploymentHandler::VersionHandler::DatabaseToSchemaVersions> depending on |
bcc72297 |
121 | your schema. |