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