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