rename upgrade_directory attr to script_directory
[dbsrgits/DBIx-Class-DeploymentHandler.git] / lib / DBIx / Class / DeploymentHandler / Deprecated.pm
CommitLineData
01342998 1package DBIx::Class::DeploymentHandler::Deprecated;
2
9deabd1f 3# ABSTRACT: (DEPRECATED) Use this if you are stuck in the past
4
01342998 5use Moose;
6use Moose::Util 'apply_all_roles';
7
8extends '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 11with '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 24with 'DBIx::Class::DeploymentHandler::WithReasonableDefaults';
01342998 25
26sub 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
571;
58
e52174e3 59# vim: ts=2 sw=2 expandtab
60
01342998 61__END__
62
bcc72297 63=head1 DEPRECATED
e52174e3 64
bcc72297 65I begrudgingly made this module (and other related modules) to make porting
66from L<DBIx::Class::Schema::Versioned> relatively simple. I will make changes
67to ensure that it works with output from L<DBIx::Class::Schema::Versioned> etc,
68but I will not add any new features to it. It already lacks numerous features
69that the full version provides in style:
70
71=over
72
73=item *
74
75Downgrades
76
77=item *
78
79Multiple files for migrations
80
81=item *
82
83Perl files in migrations
84
85=item *
86
87Shared Perl/SQL for different databases
88
89=back
90
91And there's probably more.
92
93At version 1.000000 usage of this module will emit a warning. At version
942.000000 it will be removed entirely.
95
96To migrate to the New Hotness take a look at:
97L<DBIx::Class::DeploymentHandler::VersionStorage::Deprecated/THIS SUCKS> and
98L<DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator::Deprecated/THIS SUCKS>.
99
100=head1 SYNOPSIS
101
102Look at L<DBIx::Class::DeploymentHandler/SYNPOSIS>. I won't repeat
103it here to emphasize, yet again, that this should not be used unless you really
104want to live in the past.
105
106=head1 WHERE IS ALL THE DOC?!
107
108C<DBIx::Class::DeploymentHandler::Deprecated> extends
109L<DBIx::Class::DeploymentHandler::Dad>, so that's probably the first place to
110look when you are trying to figure out how everything works.
111
961d42b1 112Next would be to look at all the pieces that fill in the blanks that
bcc72297 113L<DBIx::Class::DeploymentHandler::Dad> expects to be filled. They would be
61627cf0 114L<DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator::Deprecated>,
115L<DBIx::Class::DeploymentHandler::VersionStorage::Deprecated>, and
bcc72297 116L<DBIx::Class::DeploymentHandler::WithReasonableDefaults>. Also, this class
117is special in that it applies either
61627cf0 118L<DBIx::Class::DeploymentHandler::VersionHandler::ExplicitVersions> or
119L<DBIx::Class::DeploymentHandler::VersionHandler::DatabaseToSchemaVersions> depending on
bcc72297 120your schema.