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