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