doc for HandlesDeploy
[dbsrgits/DBIx-Class-DeploymentHandler.git] / lib / DBIx / Class / DeploymentHandler / HandlesDeploy.pm
CommitLineData
7521a845 1package DBIx::Class::DeploymentHandler::HandlesDeploy;
2use Moose::Role;
3
4requires 'prepare_install';
c8a2f7bd 5requires 'prepare_resultsource_install';
6requires 'install_resultsource';
a41a04e5 7requires 'prepare_upgrade';
76d311e7 8requires 'prepare_downgrade';
7d2a6974 9requires 'upgrade_single_step';
10requires 'downgrade_single_step';
11requires 'deploy';
7521a845 12
131;
14
37c0b85d 15# vim: ts=2 sw=2 expandtab
16
17__END__
18
96ef97e5 19# should this be renamed prepare_deploy?
20
21=method prepare_install
22
23 $deploy_method->prepare_install;
24
25=method deploy
26
5228a963 27 $dh->deploy
28
29Deploy the schema to the database.
96ef97e5 30
31=method prepare_resultsource_install
32
33 $deploy_method->prepare_resultsource_install($resultset->result_source);
34
37c0b85d 35Takes a L<DBIx::Class::ResultSource> and generates a single migration file to
36create the resultsource's table.
37
96ef97e5 38=method install_resultsource
39
40 $deploy_method->prepare_resultsource_install($resultset->result_source);
41
37c0b85d 42Takes a L<DBIx::Class::ResultSource> and runs a single migration file to
43deploy the resultsource's table.
96ef97e5 44
45=method prepare_upgrade
46
47 $deploy_method->prepare_upgrade(1, 2, [1, 2]);
48
37c0b85d 49Takes two versions and a version set. This basically is supposed to generate
50the needed C<SQL> to migrate up from the first version to the second version.
51The version set uniquely identifies the migration.
96ef97e5 52
53=method prepare_downgrade
54
55 $deploy_method->prepare_downgrade(2, 1, [1, 2]);
56
37c0b85d 57Takes two versions and a version set. This basically is supposed to generate
58the needed C<SQL> to migrate down from the first version to the second version.
59The version set uniquely identifies the migration and should match it's
60respective upgrade version set.
61
96ef97e5 62=method upgrade_single_step
63
5228a963 64 my ($ddl, $sql) = @{$dh->upgrade_single_step($version_set)||[]}
65
37c0b85d 66Call a single upgrade migration. Takes a version set as an argument.
67Optionally return C<< [ $ddl, $upgrade_sql ] >> where C<$ddl> is the DDL for
68that version of the schema and C<$upgrade_sql> is the SQL that was run to
69upgrade the database.
96ef97e5 70
71=method downgrade_single_step
72
5228a963 73 $dh->downgrade_single_step($version_set);
74
37c0b85d 75Call a single downgrade migration. Takes a version set as an argument.
76Optionally return C<< [ $ddl, $upgrade_sql ] >> where C<$ddl> is the DDL for
77that version of the schema and C<$upgrade_sql> is the SQL that was run to
78upgrade the database.
96ef97e5 79
ed1721b9 80=head1 KNOWN IMPLEMENTATIONS
81
82=over
83
84=item *
85
86L<DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator>
87
88=item *
89
90L<DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator::Deprecated>
91
92=back
93