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