1 package DBIx::Class::DeploymentHandler::HandlesDeploy;
5 # ABSTRACT: Interface for deploy methods
9 requires 'prepare_deploy';
12 requires 'prepare_resultsource_install';
13 requires 'install_resultsource';
15 requires 'prepare_upgrade';
16 requires 'upgrade_single_step';
18 requires 'prepare_downgrade';
19 requires 'downgrade_single_step';
25 # vim: ts=2 sw=2 expandtab
33 storage_type => 'SQLite'
36 Run scripts before deploying to the database
38 =method prepare_deploy
42 Generate the needed data files to install the schema to the database.
46 $dh->deploy({ version => 1 })
48 Deploy the schema to the database.
50 =method prepare_resultsource_install
52 $dh->prepare_resultsource_install({
53 result_source => $resultset->result_source,
56 Takes a L<DBIx::Class::ResultSource> and generates a single migration file to
57 create the resultsource's table.
59 =method install_resultsource
61 $dh->install_resultsource({
62 result_source => $resultset->result_source,
66 Takes a L<DBIx::Class::ResultSource> and runs a single migration file to
67 deploy the resultsource's table.
69 =method prepare_upgrade
71 $dh->prepare_upgrade({
77 Takes two versions and a version set. This basically is supposed to generate
78 the needed C<SQL> to migrate up from the first version to the second version.
79 The version set uniquely identifies the migration.
81 =method prepare_downgrade
83 $dh->prepare_downgrade({
89 Takes two versions and a version set. This basically is supposed to generate
90 the needed C<SQL> to migrate down from the first version to the second version.
91 The version set uniquely identifies the migration and should match its
92 respective upgrade version set.
94 =method upgrade_single_step
97 $dh->upgrade_single_step({ version_set => $version_set })
100 Call a single upgrade migration. Takes a version set as an argument.
101 Optionally return C<< [ $ddl, $upgrade_sql ] >> where C<$ddl> is the DDL for
102 that version of the schema and C<$upgrade_sql> is the SQL that was run to
103 upgrade the database.
105 =method downgrade_single_step
107 $dh->downgrade_single_step($version_set);
109 Call a single downgrade migration. Takes a version set as an argument.
110 Optionally return C<< [ $ddl, $upgrade_sql ] >> where C<$ddl> is the DDL for
111 that version of the schema and C<$upgrade_sql> is the SQL that was run to
112 upgrade the database.
116 $dh->txn_do(sub { ... })
118 Wrap the passed coderef in a transaction (if transactions are enabled.)
120 =head1 KNOWN IMPLEMENTATIONS
126 L<DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator>
130 L<DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator::Deprecated>