1 package DBIx::Class::DeploymentHandler::HandlesDeploy;
4 # ABSTRACT: Interface for deploy methods
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';
17 # vim: ts=2 sw=2 expandtab
21 =method prepare_install
23 (should this be renamed prepare_deploy?)
27 Generate the needed data files to install the schema to the database.
33 Deploy the schema to the database.
35 =method prepare_resultsource_install
37 $dh->prepare_resultsource_install($resultset->result_source)
39 Takes a L<DBIx::Class::ResultSource> and generates a single migration file to
40 create the resultsource's table.
42 =method install_resultsource
44 $dh->prepare_resultsource_install($resultset->result_source);
46 Takes a L<DBIx::Class::ResultSource> and runs a single migration file to
47 deploy the resultsource's table.
49 =method prepare_upgrade
51 $dh->prepare_upgrade(1, 2, [1, 2]);
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.
57 =method prepare_downgrade
59 $dh->prepare_downgrade(2, 1, [1, 2]);
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.
66 =method upgrade_single_step
68 my ($ddl, $sql) = @{$dh->upgrade_single_step($version_set)||[]}
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
75 =method downgrade_single_step
77 $dh->downgrade_single_step($version_set);
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
84 =head1 KNOWN IMPLEMENTATIONS
90 L<DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator>
94 L<DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator::Deprecated>