1DBIx::Class::DeploymentUHsaenrdlCeorn:t:rDiabdu(t3e)d PeDrBlIxD:o:cCulmaesnst:a:tDieopnloymentHandler::Dad(3)
2
3
4

NAME

6       DBIx::Class::DeploymentHandler::Dad - Parent class for
7       DeploymentHandlers
8

METHODS THAT ARE REQUIRED IN SUBCLASSES

10   deploy
11       See "deploy" in DBIx::Class::DeploymentHandler::HandlesDeploy.
12
13   version_storage_is_installed
14       See "version_storage_is_installed" in
15       DBIx::Class::DeploymentHandler::HandlesVersionStorage.
16
17   add_database_version
18       See "add_database_version" in
19       DBIx::Class::DeploymentHandler::HandlesVersionStorage.
20
21   delete_database_version
22       See "delete_database_version" in
23       DBIx::Class::DeploymentHandler::HandlesVersionStorage.
24
25   next_version_set
26       See "next_version_set" in
27       DBIx::Class::DeploymentHandler::HandlesVersioning.
28
29   previous_version_set
30       See "previous_version_set" in
31       DBIx::Class::DeploymentHandler::HandlesVersioning.
32
33   upgrade_single_step
34       See "upgrade_single_step" in
35       DBIx::Class::DeploymentHandler::HandlesDeploy.
36
37   downgrade_single_step
38       See "downgrade_single_step" in
39       DBIx::Class::DeploymentHandler::HandlesDeploy.
40
41   txn_do
42       See "txn_do" in DBIx::Class::DeploymentHandler::HandlesDeploy.
43

ORTHODOX METHODS

45       These methods are not actually required as things will probably still
46       work if you don't implement them, but if you want your subclass to get
47       along with other subclasses (or more likely, tools made to use another
48       subclass), you should probably implement these too, even if they are
49       no-ops.
50
51   database_version
52       see "database_version" in
53       DBIx::Class::DeploymentHandler::HandlesVersionStorage
54
55   prepare_deploy
56       see "prepare_deploy" in DBIx::Class::DeploymentHandler::HandlesDeploy
57
58   prepare_resultsource_install
59       see "prepare_resultsource_install" in
60       DBIx::Class::DeploymentHandler::HandlesDeploy
61
62   install_resultsource
63       see "install_resultsource" in
64       DBIx::Class::DeploymentHandler::HandlesDeploy
65
66   prepare_upgrade
67       see "prepare_upgrade" in DBIx::Class::DeploymentHandler::HandlesDeploy
68
69   prepare_downgrade
70       see "prepare_downgrade" in
71       DBIx::Class::DeploymentHandler::HandlesDeploy
72
73   SUBCLASSING
74       All of the methods mentioned in "METHODS THAT ARE REQUIRED IN
75       SUBCLASSES" and "ORTHODOX METHODS" can be implemented in any fashion
76       you choose.  In the spirit of code reuse I have used roles to implement
77       them in my two subclasses, DBIx::Class::DeploymentHandler and
78       DBIx::Class::DeploymentHandler::Deprecated, but you are free to
79       implement them entirely in a subclass if you so choose to.
80
81       For in-depth documentation on how methods are supposed to work, see the
82       roles DBIx::Class::DeploymentHandler::HandlesDeploy,
83       DBIx::Class::DeploymentHandler::HandlesVersioning, and
84       DBIx::Class::DeploymentHandler::HandlesVersionStorage.
85

ATTRIBUTES

87   schema
88       The DBIx::Class::Schema (required) that is used to talk to the database
89       and generate the DDL.
90
91   schema_version
92       The version that the schema is currently at.  Defaults to
93       "$self->schema->schema_version".
94
95   backup_directory
96       The directory where backups are stored
97
98   to_version
99       The version (defaults to schema's version) to migrate the database to
100

METHODS

102   install
103        $dh->install
104
105       or
106
107        $dh->install({ version => 1 })
108
109       Deploys the requested version into the database  Version defaults to
110       "schema_version".  Populates "version_storage" with "version" and
111       "ddl".
112
113       Note: you typically need to call "$dh->prepare_deploy" before you call
114       this method.
115
116       Note: you cannot install on top of an already installed database
117
118   upgrade
119        $dh->upgrade
120
121       Upgrades the database one step at a time till "next_version_set"
122       returns "undef".  Each upgrade step will add a "version", "ddl", and
123       "upgrade_sql" to the version storage (if "ddl" and/or "upgrade_sql" are
124       returned from "upgrade_single_step".
125
126   downgrade
127        $dh->downgrade
128
129       Downgrades the database one step at a time till "previous_version_set"
130       returns "undef".  Each downgrade step will delete a "version" from the
131       version storage.
132
133   backup
134        $dh->backup
135
136       Simply calls backup on the "$schema->storage", passing in
137       "$self->backup_directory" as an argument.  Please test yourself before
138       assuming it will work.
139

AUTHOR

141       Arthur Axel "fREW" Schmidt <frioux+cpan@gmail.com>
142
144       This software is copyright (c) 2019 by Arthur Axel "fREW" Schmidt.
145
146       This is free software; you can redistribute it and/or modify it under
147       the same terms as the Perl 5 programming language system itself.
148
149
150
151perl v5.30.0                      2019-07D-B2I6x::Class::DeploymentHandler::Dad(3)
Impressum