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