Add some basic doc and a little cleanup
[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=method prepare_install
20
e3776e58 21 (should this be renamed prepare_deploy?)
22
23 $dh->prepare_install
24
25Generate the needed data files to install the schema to the database.
96ef97e5 26
27=method deploy
28
5228a963 29 $dh->deploy
30
31Deploy the schema to the database.
96ef97e5 32
33=method prepare_resultsource_install
34
e3776e58 35 $dh->prepare_resultsource_install($resultset->result_source)
96ef97e5 36
37c0b85d 37Takes a L<DBIx::Class::ResultSource> and generates a single migration file to
38create the resultsource's table.
39
96ef97e5 40=method install_resultsource
41
e3776e58 42 $dh->prepare_resultsource_install($resultset->result_source);
96ef97e5 43
37c0b85d 44Takes a L<DBIx::Class::ResultSource> and runs a single migration file to
45deploy the resultsource's table.
96ef97e5 46
47=method prepare_upgrade
48
e3776e58 49 $dh->prepare_upgrade(1, 2, [1, 2]);
96ef97e5 50
37c0b85d 51Takes two versions and a version set. This basically is supposed to generate
52the needed C<SQL> to migrate up from the first version to the second version.
53The version set uniquely identifies the migration.
96ef97e5 54
55=method prepare_downgrade
56
e3776e58 57 $dh->prepare_downgrade(2, 1, [1, 2]);
96ef97e5 58
37c0b85d 59Takes two versions and a version set. This basically is supposed to generate
60the needed C<SQL> to migrate down from the first version to the second version.
61The version set uniquely identifies the migration and should match it's
62respective upgrade version set.
63
96ef97e5 64=method upgrade_single_step
65
5228a963 66 my ($ddl, $sql) = @{$dh->upgrade_single_step($version_set)||[]}
67
37c0b85d 68Call a single upgrade migration. Takes a version set as an argument.
69Optionally return C<< [ $ddl, $upgrade_sql ] >> where C<$ddl> is the DDL for
70that version of the schema and C<$upgrade_sql> is the SQL that was run to
71upgrade the database.
96ef97e5 72
73=method downgrade_single_step
74
5228a963 75 $dh->downgrade_single_step($version_set);
76
37c0b85d 77Call a single downgrade migration. Takes a version set as an argument.
78Optionally return C<< [ $ddl, $upgrade_sql ] >> where C<$ddl> is the DDL for
79that version of the schema and C<$upgrade_sql> is the SQL that was run to
80upgrade the database.
96ef97e5 81
ed1721b9 82=head1 KNOWN IMPLEMENTATIONS
83
84=over
85
86=item *
87
88L<DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator>
89
90=item *
91
92L<DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator::Deprecated>
93
94=back
95