.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "DBIx::Class::DeploymentHandler::Dad 3pm" .TH DBIx::Class::DeploymentHandler::Dad 3pm "2022-12-10" "perl v5.36.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" DBIx::Class::DeploymentHandler::Dad \- Parent class for DeploymentHandlers .SH "METHODS THAT ARE REQUIRED IN SUBCLASSES" .IX Header "METHODS THAT ARE REQUIRED IN SUBCLASSES" .SS "deploy" .IX Subsection "deploy" See \*(L"deploy\*(R" in DBIx::Class::DeploymentHandler::HandlesDeploy. .SS "version_storage_is_installed" .IX Subsection "version_storage_is_installed" See \*(L"version_storage_is_installed\*(R" in DBIx::Class::DeploymentHandler::HandlesVersionStorage. .SS "add_database_version" .IX Subsection "add_database_version" See \*(L"add_database_version\*(R" in DBIx::Class::DeploymentHandler::HandlesVersionStorage. .SS "delete_database_version" .IX Subsection "delete_database_version" See \*(L"delete_database_version\*(R" in DBIx::Class::DeploymentHandler::HandlesVersionStorage. .SS "next_version_set" .IX Subsection "next_version_set" See \*(L"next_version_set\*(R" in DBIx::Class::DeploymentHandler::HandlesVersioning. .SS "previous_version_set" .IX Subsection "previous_version_set" See \*(L"previous_version_set\*(R" in DBIx::Class::DeploymentHandler::HandlesVersioning. .SS "upgrade_single_step" .IX Subsection "upgrade_single_step" See \*(L"upgrade_single_step\*(R" in DBIx::Class::DeploymentHandler::HandlesDeploy. .SS "downgrade_single_step" .IX Subsection "downgrade_single_step" See \*(L"downgrade_single_step\*(R" in DBIx::Class::DeploymentHandler::HandlesDeploy. .SS "txn_do" .IX Subsection "txn_do" See \*(L"txn_do\*(R" in DBIx::Class::DeploymentHandler::HandlesDeploy. .SH "ORTHODOX METHODS" .IX Header "ORTHODOX METHODS" These methods are not actually \fBrequired\fR as things will probably still work if you don't implement them, but if you want your subclass to get along with other subclasses (or more likely, tools made to use another subclass), you should probably implement these too, even if they are no-ops. .SS "database_version" .IX Subsection "database_version" see \*(L"database_version\*(R" in DBIx::Class::DeploymentHandler::HandlesVersionStorage .SS "prepare_deploy" .IX Subsection "prepare_deploy" see \*(L"prepare_deploy\*(R" in DBIx::Class::DeploymentHandler::HandlesDeploy .SS "prepare_resultsource_install" .IX Subsection "prepare_resultsource_install" see \*(L"prepare_resultsource_install\*(R" in DBIx::Class::DeploymentHandler::HandlesDeploy .SS "install_resultsource" .IX Subsection "install_resultsource" see \*(L"install_resultsource\*(R" in DBIx::Class::DeploymentHandler::HandlesDeploy .SS "prepare_upgrade" .IX Subsection "prepare_upgrade" see \*(L"prepare_upgrade\*(R" in DBIx::Class::DeploymentHandler::HandlesDeploy .SS "prepare_downgrade" .IX Subsection "prepare_downgrade" see \*(L"prepare_downgrade\*(R" in DBIx::Class::DeploymentHandler::HandlesDeploy .SS "\s-1SUBCLASSING\s0" .IX Subsection "SUBCLASSING" All of the methods mentioned in \*(L"\s-1METHODS THAT ARE REQUIRED IN SUBCLASSES\*(R"\s0 and \&\*(L"\s-1ORTHODOX METHODS\*(R"\s0 can be implemented in any fashion you choose. In the spirit of code reuse I have used roles to implement them in my 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. .PP 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. .SH "ATTRIBUTES" .IX Header "ATTRIBUTES" .SS "schema" .IX Subsection "schema" The DBIx::Class::Schema (\fBrequired\fR) that is used to talk to the database and generate the \s-1DDL.\s0 .SS "schema_version" .IX Subsection "schema_version" The version that the schema is currently at. Defaults to \&\f(CW\*(C`$self\->schema\->schema_version\*(C'\fR. .SS "backup_directory" .IX Subsection "backup_directory" The directory where backups are stored .SS "to_version" .IX Subsection "to_version" The version (defaults to schema's version) to migrate the database to .SH "METHODS" .IX Header "METHODS" .SS "install" .IX Subsection "install" .Vb 1 \& $dh\->install .Ve .PP or .PP .Vb 1 \& $dh\->install({ version => 1 }) .Ve .PP Deploys the requested version into the database Version defaults to \&\*(L"schema_version\*(R". Populates \f(CW\*(C`version_storage\*(C'\fR with \f(CW\*(C`version\*(C'\fR and \f(CW\*(C`ddl\*(C'\fR. .PP \&\fBNote\fR: you typically need to call \f(CW\*(C`$dh\->prepare_deploy\*(C'\fR before you call this method. .PP \&\fBNote\fR: you cannot install on top of an already installed database .SS "upgrade" .IX Subsection "upgrade" .Vb 1 \& $dh\->upgrade .Ve .PP Upgrades the database one step at a time till \*(L"next_version_set\*(R" returns \f(CW\*(C`undef\*(C'\fR. Each upgrade step will add a \f(CW\*(C`version\*(C'\fR, \f(CW\*(C`ddl\*(C'\fR, and \&\f(CW\*(C`upgrade_sql\*(C'\fR to the version storage (if \f(CW\*(C`ddl\*(C'\fR and/or \f(CW\*(C`upgrade_sql\*(C'\fR are returned from \*(L"upgrade_single_step\*(R". .SS "downgrade" .IX Subsection "downgrade" .Vb 1 \& $dh\->downgrade .Ve .PP Downgrades the database one step at a time till \*(L"previous_version_set\*(R" returns \f(CW\*(C`undef\*(C'\fR. Each downgrade step will delete a \f(CW\*(C`version\*(C'\fR from the version storage. .SS "backup" .IX Subsection "backup" .Vb 1 \& $dh\->backup .Ve .PP Simply calls backup on the \f(CW\*(C`$schema\->storage\*(C'\fR, passing in \&\f(CW\*(C`$self\->backup_directory\*(C'\fR as an argument. Please test yourself before assuming it will work. .SH "AUTHOR" .IX Header "AUTHOR" Arthur Axel \*(L"fREW\*(R" Schmidt .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is copyright (c) 2019 by Arthur Axel \*(L"fREW\*(R" Schmidt. .PP This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.