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