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