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 =method prepare_install
21 (should this be renamed prepare_deploy?)
25 Generate the needed data files to install the schema to the database.
31 Deploy the schema to the database.
33 =method prepare_resultsource_install
35 $dh->prepare_resultsource_install($resultset->result_source)
37 Takes a L<DBIx::Class::ResultSource> and generates a single migration file to
38 create the resultsource's table.
40 =method install_resultsource
42 $dh->prepare_resultsource_install($resultset->result_source);
44 Takes a L<DBIx::Class::ResultSource> and runs a single migration file to
45 deploy the resultsource's table.
47 =method prepare_upgrade
49 $dh->prepare_upgrade(1, 2, [1, 2]);
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.
55 =method prepare_downgrade
57 $dh->prepare_downgrade(2, 1, [1, 2]);
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.
64 =method upgrade_single_step
66 my ($ddl, $sql) = @{$dh->upgrade_single_step($version_set)||[]}
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
73 =method downgrade_single_step
75 $dh->downgrade_single_step($version_set);
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
82 =head1 KNOWN IMPLEMENTATIONS
88 L<DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator>
92 L<DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator::Deprecated>