rearrange doc
[dbsrgits/DBIx-Class-DeploymentHandler.git] / lib / DBIx / Class / DeploymentHandler / HandlesVersioning.pm
CommitLineData
24794769 1package DBIx::Class::DeploymentHandler::HandlesVersioning;
2use Moose::Role;
3
f344dd91 4# note: the sets returned need to match!
24794769 5requires 'next_version_set';
f344dd91 6requires 'previous_version_set';
24794769 7
24794769 81;
9
10__END__
11
96ef97e5 12=method next_version_set
13
5228a963 14 print 'versions to install: ';
15 while (my $vs = $dh->next_version_set) {
16 print join q(, ), @{$vs}
96ef97e5 17 }
5228a963 18 print qq(\n);
19
20return an arrayref describing each version that needs to be
21installed to upgrade to C<< $dh->to_version >>.
96ef97e5 22
23=method previous_version_set
24
5228a963 25 print 'versions to uninstall: ';
26 while (my $vs = $dh->previous_version_set) {
27 print join q(, ), @{$vs}
96ef97e5 28 }
5228a963 29 print qq(\n);
30
31return an arrayref describing each version that needs to be
32"installed" to downgrade to C<< $dh->to_version >>.
96ef97e5 33
24794769 34# normally a VersionHandler will take
35# a to_version and yeild an iterator of
36# "version sets" or something like that.
37#
38# A "version set" is basically an arrayref
39# of "version numbers" (which we already know
40# is vague as is.) Typically an call to a
41# VH w/ a db version of 1 and a "to_version"
42# of 5 will iterate over something like this:
43# [1, 2]
44# [2, 3]
45# [3, 4]
46# [4, 5]
47#
48# Of course rob wants to be able to have dep
49# management with his versions, so I *think* his
50# would work like this:
51#
52# to_version = 7, db_version = 1
53# [1]
54# [5]
55# [7]
56#
57# Because 7 depended on 5, 5 was installed first;
58# note that this potentially never released module
59# doesn't use version pairs, instead it just yeilds
60# versions. Version pairs are too much work for users
61# to have to deal with in that sitation. We may
62# actually switch to this for other versioners.
63#
64# The upshot of all this is that the DeploymentMethod
65# needs to be able to take an ArrayRef[VersionNumber],
66# instead of just a pair of VersionNumber.
67vim: ts=2 sw=2 expandtab