57520cc9b59981aba1bd615be061fee33b50700c
[dbsrgits/DBIx-Class-DeploymentHandler.git] / lib / DBIx / Class / DeploymentHandler / Deprecated.pm
1 package DBIx::Class::DeploymentHandler::Deprecated;
2
3 # ABSTRACT: (DEPRECATED) Use this if you are stuck in the past
4
5 use Moose;
6 use Moose::Util 'apply_all_roles';
7
8 extends 'DBIx::Class::DeploymentHandler::Dad';
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
11 with 'DBIx::Class::DeploymentHandler::Deprecated::WithDeprecatedSqltDeployMethod',
12      'DBIx::Class::DeploymentHandler::Deprecated::WithDeprecatedVersionStorage';
13 with 'DBIx::Class::DeploymentHandler::WithReasonableDefaults';
14
15 sub BUILD {
16   my $self = shift;
17
18   if ($self->schema->can('ordered_versions') && $self->schema->ordered_versions) {
19     apply_all_roles(
20       $self,
21       'DBIx::Class::DeploymentHandler::WithExplicitVersions'
22     );
23   } else {
24     apply_all_roles(
25       $self,
26       'DBIx::Class::DeploymentHandler::WithDatabaseToSchemaVersions'
27     );
28   }
29 }
30
31 __PACKAGE__->meta->make_immutable;
32
33 1;
34
35 # vim: ts=2 sw=2 expandtab
36
37 __END__
38
39 =head1 DEPRECATED
40
41 I begrudgingly made this module (and other related modules) to make porting
42 from L<DBIx::Class::Schema::Versioned> relatively simple.  I will make changes
43 to ensure that it works with output from L<DBIx::Class::Schema::Versioned> etc,
44 but I will not add any new features to it.  It already lacks numerous features
45 that the full version provides in style:
46
47 =over
48
49 =item *
50
51 Downgrades
52
53 =item *
54
55 Multiple files for migrations
56
57 =item *
58
59 Perl files in migrations
60
61 =item *
62
63 Shared Perl/SQL for different databases
64
65 =back
66
67 And there's probably more.
68
69 At version 1.000000 usage of this module will emit a warning.  At version
70 2.000000 it will be removed entirely.
71
72 To migrate to the New Hotness take a look at:
73 L<DBIx::Class::DeploymentHandler::VersionStorage::Deprecated/THIS SUCKS> and
74 L<DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator::Deprecated/THIS SUCKS>.
75
76 =head1 SYNOPSIS
77
78 Look at L<DBIx::Class::DeploymentHandler/SYNPOSIS>.  I won't repeat
79 it here to emphasize, yet again, that this should not be used unless you really
80 want to live in the past.
81
82 =head1 WHERE IS ALL THE DOC?!
83
84 C<DBIx::Class::DeploymentHandler::Deprecated> extends
85 L<DBIx::Class::DeploymentHandler::Dad>, so that's probably the first place to
86 look when you are trying to figure out how everything works.
87
88 Next would be to look at all the roles that fill in the blanks that
89 L<DBIx::Class::DeploymentHandler::Dad> expects to be filled.  They would be
90 L<DBIx::Class::DeploymentHandler::Deprecated::WithSqltDeployMethod>,
91 L<DBIx::Class::DeploymentHandler::Deprecated::WithDeprecatedVersionStorage>, and
92 L<DBIx::Class::DeploymentHandler::WithReasonableDefaults>.  Also, this class
93 is special in that it applies either
94 L<DBIx::Class::DeploymentHandler::WithExplicitVersions> or
95 L<DBIx::Class::DeploymentHandler::WithDatabaseToSchemaVersions> depending on
96 your schema.