1 package DBIx::Class::DeploymentHandler::HandlesDeploy;
4 requires 'prepare_install';
5 requires 'prepare_resultsource_install';
6 requires 'install_resultsource';
7 requires 'prepare_upgrade';
8 requires 'prepare_downgrade';
9 requires 'upgrade_single_step';
10 requires 'downgrade_single_step';
15 # vim: ts=2 sw=2 expandtab
19 # should this be renamed prepare_deploy?
21 =method prepare_install
23 $deploy_method->prepare_install;
29 Deploy the schema to the database.
31 =method prepare_resultsource_install
33 $deploy_method->prepare_resultsource_install($resultset->result_source);
35 Takes a L<DBIx::Class::ResultSource> and generates a single migration file to
36 create the resultsource's table.
38 =method install_resultsource
40 $deploy_method->prepare_resultsource_install($resultset->result_source);
42 Takes a L<DBIx::Class::ResultSource> and runs a single migration file to
43 deploy the resultsource's table.
45 =method prepare_upgrade
47 $deploy_method->prepare_upgrade(1, 2, [1, 2]);
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.
53 =method prepare_downgrade
55 $deploy_method->prepare_downgrade(2, 1, [1, 2]);
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.
62 =method upgrade_single_step
64 my ($ddl, $sql) = @{$dh->upgrade_single_step($version_set)||[]}
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
71 =method downgrade_single_step
73 $dh->downgrade_single_step($version_set);
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
80 =head1 KNOWN IMPLEMENTATIONS
86 L<DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator>
90 L<DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator::Deprecated>