1 package DBIx::Class::DeploymentHandler::HandlesDeploy;
4 # ABSTRACT: Interface for deploy methods
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
30 Run scripts before deploying to the database
32 =method prepare_deploy
36 Generate the needed data files to install the schema to the database.
42 Deploy the schema to the database.
44 =method prepare_resultsource_install
46 $dh->prepare_resultsource_install($resultset->result_source)
48 Takes a L<DBIx::Class::ResultSource> and generates a single migration file to
49 create the resultsource's table.
51 =method install_resultsource
53 $dh->prepare_resultsource_install($resultset->result_source);
55 Takes a L<DBIx::Class::ResultSource> and runs a single migration file to
56 deploy the resultsource's table.
58 =method prepare_upgrade
60 $dh->prepare_upgrade(1, 2, [1, 2]);
62 Takes two versions and a version set. This basically is supposed to generate
63 the needed C<SQL> to migrate up from the first version to the second version.
64 The version set uniquely identifies the migration.
66 =method prepare_downgrade
68 $dh->prepare_downgrade(2, 1, [1, 2]);
70 Takes two versions and a version set. This basically is supposed to generate
71 the needed C<SQL> to migrate down from the first version to the second version.
72 The version set uniquely identifies the migration and should match it's
73 respective upgrade version set.
75 =method upgrade_single_step
77 my ($ddl, $sql) = @{$dh->upgrade_single_step($version_set)||[]}
79 Call a single upgrade 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 =method downgrade_single_step
86 $dh->downgrade_single_step($version_set);
88 Call a single downgrade migration. Takes a version set as an argument.
89 Optionally return C<< [ $ddl, $upgrade_sql ] >> where C<$ddl> is the DDL for
90 that version of the schema and C<$upgrade_sql> is the SQL that was run to
93 =head1 KNOWN IMPLEMENTATIONS
99 L<DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator>
103 L<DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator::Deprecated>