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