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';
24 # vim: ts=2 sw=2 expandtab
32 storage_type => 'SQLite'
35 Run scripts before deploying to the database
37 =method prepare_deploy
41 Generate the needed data files to install the schema to the database.
45 $dh->deploy({ version => 1 })
47 Deploy the schema to the database.
49 =method prepare_resultsource_install
51 $dh->prepare_resultsource_install({
52 result_source => $resultset->result_source,
55 Takes a L<DBIx::Class::ResultSource> and generates a single migration file to
56 create the resultsource's table.
58 =method install_resultsource
60 $dh->install_resultsource({
61 result_source => $resultset->result_source,
65 Takes a L<DBIx::Class::ResultSource> and runs a single migration file to
66 deploy the resultsource's table.
68 =method prepare_upgrade
70 $dh->prepare_upgrade({
76 Takes two versions and a version set. This basically is supposed to generate
77 the needed C<SQL> to migrate up from the first version to the second version.
78 The version set uniquely identifies the migration.
80 =method prepare_downgrade
82 $dh->prepare_downgrade({
88 Takes two versions and a version set. This basically is supposed to generate
89 the needed C<SQL> to migrate down from the first version to the second version.
90 The version set uniquely identifies the migration and should match its
91 respective upgrade version set.
93 =method upgrade_single_step
96 $dh->upgrade_single_step({ version_set => $version_set })
99 Call a single upgrade migration. Takes a version set as an argument.
100 Optionally return C<< [ $ddl, $upgrade_sql ] >> where C<$ddl> is the DDL for
101 that version of the schema and C<$upgrade_sql> is the SQL that was run to
102 upgrade the database.
104 =method downgrade_single_step
106 $dh->downgrade_single_step($version_set);
108 Call a single downgrade migration. Takes a version set as an argument.
109 Optionally return C<< [ $ddl, $upgrade_sql ] >> where C<$ddl> is the DDL for
110 that version of the schema and C<$upgrade_sql> is the SQL that was run to
111 upgrade the database.
115 $dh->txn_do(sub { ... })
117 Wrap the passed coderef in a transaction (if transactions are enabled.)
119 =head1 KNOWN IMPLEMENTATIONS
125 L<DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator>
129 L<DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator::Deprecated>