DBIx::Class::DeploymentHandler::HandlesDeploy(3pm)

DBIx::Class::DeploymentHandler::HandlesDeploy3pm

Interface for deploy methods

Known implementations

•

DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator

•

DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator::Deprecated

Methods

initialize

 $dh->initialize({
   version      => 1,
   storage_type => 'SQLite'
 });

Run scripts before deploying to the database

prepare_deploy

 $dh->prepare_deploy

Generate the needed data files to install the schema to the database.

deploy

 $dh->deploy({ version => 1 })

Deploy the schema to the database.

prepare_resultsource_install

 $dh->prepare_resultsource_install({
   result_source => $resultset->result_source,
 })

Takes a DBIx::Class::ResultSource and generates a single migration file to create the resultsource's table.

install_resultsource

 $dh->install_resultsource({
   result_source => $resultset->result_source,
   version       => 1,
 })

Takes a DBIx::Class::ResultSource and runs a single migration file to deploy the resultsource's table.

prepare_upgrade

 $dh->prepare_upgrade({
   from_version => 1,
   to_version   => 2,
   version_set  => [1, 2]
 });

Takes two versions and a version set. This basically is supposed to generate the needed "SQL" to migrate up from the first version to the second version. The version set uniquely identifies the migration.

prepare_downgrade

 $dh->prepare_downgrade({
   from_version => 2,
   to_version   => 1,
   version_set  => [1, 2]
 });

Takes two versions and a version set. This basically is supposed to generate the needed "SQL" to migrate down from the first version to the second version. The version set uniquely identifies the migration and should match its respective upgrade version set.

upgrade_single_step

 my ($ddl, $sql) = @{
   $dh->upgrade_single_step({ version_set => $version_set })
 ||[]}

Call a single upgrade migration. Takes a version set as an argument. Optionally return "[ $ddl, $upgrade_sql ]" where $ddl is the DDL for that version of the schema and $upgrade_sql is the SQL that was run to upgrade the database.

downgrade_single_step

 $dh->downgrade_single_step($version_set);

Call a single downgrade migration. Takes a version set as an argument. Optionally return "[ $ddl, $upgrade_sql ]" where $ddl is the DDL for that version of the schema and $upgrade_sql is the SQL that was run to upgrade the database.

txn_do

 $dh->txn_do(sub { ... })

Wrap the passed coderef in a transaction (if transactions are enabled.)

Releases

6 releases since Debian 8 (Jessie); the text changed 5 times.

  1. 8
  2. 9
  3. 10
  4. 11
  5. 12
  6. 13

Author

Arthur Axel "fREW" Schmidt <[email protected]>

From libdbix-class-deploymenthandler-perl 0.002234-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.