1 package DBIx::Class::DeploymentHandler::HandlesDeploy;
4 # ABSTRACT: Interface for deploy methods
6 requires 'prepare_deploy';
9 requires 'prepare_resultsource_install';
10 requires 'install_resultsource';
12 requires 'prepare_upgrade';
13 requires 'upgrade_single_step';
15 requires 'prepare_downgrade';
16 requires 'downgrade_single_step';
20 # vim: ts=2 sw=2 expandtab
24 =method prepare_deploy
28 Generate the needed data files to install the schema to the database.
34 Deploy the schema to the database.
36 =method prepare_resultsource_install
38 $dh->prepare_resultsource_install($resultset->result_source)
40 Takes a L<DBIx::Class::ResultSource> and generates a single migration file to
41 create the resultsource's table.
43 =method install_resultsource
45 $dh->prepare_resultsource_install($resultset->result_source);
47 Takes a L<DBIx::Class::ResultSource> and runs a single migration file to
48 deploy the resultsource's table.
50 =method prepare_upgrade
52 $dh->prepare_upgrade(1, 2, [1, 2]);
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.
58 =method prepare_downgrade
60 $dh->prepare_downgrade(2, 1, [1, 2]);
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.
67 =method upgrade_single_step
69 my ($ddl, $sql) = @{$dh->upgrade_single_step($version_set)||[]}
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
76 =method downgrade_single_step
78 $dh->downgrade_single_step($version_set);
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
85 =head1 KNOWN IMPLEMENTATIONS
91 L<DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator>
95 L<DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator::Deprecated>