1 package DBIx::Class::DeploymentHandler::HandlesDeploy;
4 # ABSTRACT: Interface for deploy methods
6 requires 'preinstall_scripts';
8 requires 'prepare_deploy';
11 requires 'prepare_resultsource_install';
12 requires 'install_resultsource';
14 requires 'prepare_upgrade';
15 requires 'upgrade_single_step';
17 requires 'prepare_downgrade';
18 requires 'downgrade_single_step';
22 # vim: ts=2 sw=2 expandtab
26 =method prepare_deploy
30 Generate the needed data files to install the schema to the database.
36 Deploy the schema to the database.
38 =method prepare_resultsource_install
40 $dh->prepare_resultsource_install($resultset->result_source)
42 Takes a L<DBIx::Class::ResultSource> and generates a single migration file to
43 create the resultsource's table.
45 =method install_resultsource
47 $dh->prepare_resultsource_install($resultset->result_source);
49 Takes a L<DBIx::Class::ResultSource> and runs a single migration file to
50 deploy the resultsource's table.
52 =method prepare_upgrade
54 $dh->prepare_upgrade(1, 2, [1, 2]);
56 Takes two versions and a version set. This basically is supposed to generate
57 the needed C<SQL> to migrate up from the first version to the second version.
58 The version set uniquely identifies the migration.
60 =method prepare_downgrade
62 $dh->prepare_downgrade(2, 1, [1, 2]);
64 Takes two versions and a version set. This basically is supposed to generate
65 the needed C<SQL> to migrate down from the first version to the second version.
66 The version set uniquely identifies the migration and should match it's
67 respective upgrade version set.
69 =method upgrade_single_step
71 my ($ddl, $sql) = @{$dh->upgrade_single_step($version_set)||[]}
73 Call a single upgrade migration. Takes a version set as an argument.
74 Optionally return C<< [ $ddl, $upgrade_sql ] >> where C<$ddl> is the DDL for
75 that version of the schema and C<$upgrade_sql> is the SQL that was run to
78 =method downgrade_single_step
80 $dh->downgrade_single_step($version_set);
82 Call a single downgrade migration. Takes a version set as an argument.
83 Optionally return C<< [ $ddl, $upgrade_sql ] >> where C<$ddl> is the DDL for
84 that version of the schema and C<$upgrade_sql> is the SQL that was run to
87 =head1 KNOWN IMPLEMENTATIONS
93 L<DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator>
97 L<DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator::Deprecated>