Commit | Line | Data |
7521a845 |
1 | package DBIx::Class::DeploymentHandler::HandlesDeploy; |
2 | use Moose::Role; |
3 | |
9deabd1f |
4 | # ABSTRACT: Interface for deploy methods |
5 | |
91557c90 |
6 | requires 'prepare_deploy'; |
7 | requires 'deploy'; |
8 | |
c8a2f7bd |
9 | requires 'prepare_resultsource_install'; |
10 | requires 'install_resultsource'; |
91557c90 |
11 | |
a41a04e5 |
12 | requires 'prepare_upgrade'; |
7d2a6974 |
13 | requires 'upgrade_single_step'; |
91557c90 |
14 | |
15 | requires 'prepare_downgrade'; |
7d2a6974 |
16 | requires 'downgrade_single_step'; |
7521a845 |
17 | |
18 | 1; |
19 | |
37c0b85d |
20 | # vim: ts=2 sw=2 expandtab |
21 | |
22 | __END__ |
23 | |
91557c90 |
24 | =method prepare_deploy |
e3776e58 |
25 | |
91557c90 |
26 | $dh->prepare_deploy |
e3776e58 |
27 | |
28 | Generate the needed data files to install the schema to the database. |
96ef97e5 |
29 | |
30 | =method deploy |
31 | |
5228a963 |
32 | $dh->deploy |
33 | |
34 | Deploy the schema to the database. |
96ef97e5 |
35 | |
36 | =method prepare_resultsource_install |
37 | |
e3776e58 |
38 | $dh->prepare_resultsource_install($resultset->result_source) |
96ef97e5 |
39 | |
37c0b85d |
40 | Takes a L<DBIx::Class::ResultSource> and generates a single migration file to |
41 | create the resultsource's table. |
42 | |
96ef97e5 |
43 | =method install_resultsource |
44 | |
e3776e58 |
45 | $dh->prepare_resultsource_install($resultset->result_source); |
96ef97e5 |
46 | |
37c0b85d |
47 | Takes a L<DBIx::Class::ResultSource> and runs a single migration file to |
48 | deploy the resultsource's table. |
96ef97e5 |
49 | |
50 | =method prepare_upgrade |
51 | |
e3776e58 |
52 | $dh->prepare_upgrade(1, 2, [1, 2]); |
96ef97e5 |
53 | |
37c0b85d |
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. |
96ef97e5 |
57 | |
58 | =method prepare_downgrade |
59 | |
e3776e58 |
60 | $dh->prepare_downgrade(2, 1, [1, 2]); |
96ef97e5 |
61 | |
37c0b85d |
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 | |
96ef97e5 |
67 | =method upgrade_single_step |
68 | |
5228a963 |
69 | my ($ddl, $sql) = @{$dh->upgrade_single_step($version_set)||[]} |
70 | |
37c0b85d |
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. |
96ef97e5 |
75 | |
76 | =method downgrade_single_step |
77 | |
5228a963 |
78 | $dh->downgrade_single_step($version_set); |
79 | |
37c0b85d |
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. |
96ef97e5 |
84 | |
ed1721b9 |
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 | |