DBIx::C...ler::Dad(3)
π DBIx::Class::DeploymentHandler::Dad π
okay so bestie, welcome to the DBIx::C...ler::Dad(3) page from the User Contributed Perl Documentation π«Ά this is the parent class for DeploymentHandlers β like, the mom of the whole DeploymentHandler fam, and she has expectations for her kids. no cap.
β¨ NAME β¨
DBIx::Class::DeploymentHandler::Dad β Parent class for DeploymentHandlers π
πΈ METHODS THAT ARE REQUIRED IN SUBCLASSES πΈ
these are the non-negotiables, bestie. if your subclass doesn't have these, it's not giving what it needs to give π
deployβ See "deploy" inDBIx::Class::DeploymentHandler::HandlesDeploy.version_storage_is_installedβ See "version_storage_is_installed" inDBIx::Class::DeploymentHandler::HandlesVersionStorage.add_database_versionβ See "add_database_version" inDBIx::Class::DeploymentHandler::HandlesVersionStorage.delete_database_versionβ See "delete_database_version" inDBIx::Class::DeploymentHandler::HandlesVersionStorage.next_version_setβ See "next_version_set" inDBIx::Class::DeploymentHandler::HandlesVersioning.previous_version_setβ See "previous_version_set" inDBIx::Class::DeploymentHandler::HandlesVersioning.upgrade_single_stepβ See "upgrade_single_step" inDBIx::Class::DeploymentHandler::HandlesDeploy.downgrade_single_stepβ See "downgrade_single_step" inDBIx::Class::DeploymentHandler::HandlesDeploy.txn_doβ See "txn_do" inDBIx::Class::DeploymentHandler::HandlesDeploy.
π ORTHODOX METHODS π
ngl these aren't technically required β things will probably still work if you don't implement them π but listen. if you want your subclass to actually get along with other subclasses (or, like, more realistically, tools built to use a different subclass), you should probably implement these too. even if they're just no-ops. it's giving courtesy. it's giving community. β¨
database_versionβ see "database_version" inDBIx::Class::DeploymentHandler::HandlesVersionStorageprepare_deployβ see "prepare_deploy" inDBIx::Class::DeploymentHandler::HandlesDeployprepare_resultsource_installβ see "prepare_resultsource_install" inDBIx::Class::DeploymentHandler::HandlesDeployinstall_resultsourceβ see "install_resultsource" inDBIx::Class::DeploymentHandler::HandlesDeployprepare_upgradeβ see "prepare_upgrade" inDBIx::Class::DeploymentHandler::HandlesDeployprepare_downgradeβ see "prepare_downgrade" inDBIx::Class::DeploymentHandler::HandlesDeploy
π¦ SUBCLASSING π¦
all of the methods mentioned up in "METHODS THAT ARE REQUIRED IN SUBCLASSES" and "ORTHODOX METHODS" can be implemented any fashion you choose. literally whatever vibe you want.
in the spirit of code reuse, the author used roles to implement them in his two subclasses β DBIx::Class::DeploymentHandler and DBIx::Class::DeploymentHandler::Deprecated β but you are free to implement them entirely in a subclass if you so choose to. your code, your rules π
for in-depth documentation on how methods are supposed to work, see the roles DBIx::Class::DeploymentHandler::HandlesDeploy, DBIx::Class::DeploymentHandler::HandlesVersioning, and DBIx::Class::DeploymentHandler::HandlesVersionStorage. those are the β¨source of truthβ¨ bestie, go read them.
π ATTRIBUTES π
schemaβ TheDBIx::Class::Schema(required, no skipping this one π) that is used to talk to the database and generate the DDL.schema_versionβ The version that the schema is currently at. Defaults to"$self->schema->schema_version".backup_directoryβ The directory where backups are stored.to_versionβ The version (defaults to schema's version) to migrate the database to.
π METHODS π
π install π
$dh->install
or
$dh->install({ version => 1 })
Deploys the requested version into the database. Version defaults to "schema_version". Populates "version_storage" with "version" and "ddl".
π Note: you typically need to call "$dh->prepare_deploy" before you call this method.
β οΈ Note: you cannot install on top of an already installed database. do not try it. it's not the vibe.
π upgrade π
$dh->upgrade
Upgrades the database one step at a time till "next_version_set" returns "undef". Each upgrade step will add a "version", "ddl", and "upgrade_sql" to the version storage (if "ddl" and/or "upgrade_sql" are returned from "upgrade_single_step". π₯
π downgrade π
$dh->downgrade
Downgrades the database one step at a time till "previous_version_set" returns "undef". Each downgrade step will delete a "version" from the version storage. bye bye version π«‘
π backup π
$dh->backup
Simply calls backup on the "$schema->storage", passing in "$self->backup_directory" as an argument.
π¨ Please test yourself before assuming it will work. fr fr. do not come crying to me, test your backups.
π AUTHOR π
Arthur Axel "fREW" Schmidt <frioux+cpan@gmail.com>
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2025 by Arthur Axel "fREW" Schmidt.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
and that's the whole page bestie, periodt π
this was perl v5.42.0, dated 2026-01-17, and you just read DBIx::C...ler::Dad(3) β go forth and deploy responsibly, ily π«Άβ¨π
π¦ where this page comes from
- fedora 44: perl-DBIx-Class-DeploymentHandler 0.002235-2.fc44 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms