use VersionStorage in the rest of our stuff
[dbsrgits/DBIx-Class-DeploymentHandler.git] / lib / DBIx / Class / DeploymentHandler / HandlesVersioning.pm
CommitLineData
24794769 1package DBIx::Class::DeploymentHandler::HandlesVersioning;
2use Moose::Role;
3
4requires 'next_version_set';
5
6has schema => (
7 isa => 'DBIx::Class::Schema',
8 is => 'ro',
9 required => 1,
24f4524b 10 handles => [qw( schema_version )],
24794769 11);
12
fb105cfa 13has version_storage => (
14 does => 'DBIx::Class::DeploymentHandler::HandlesVersionStorage',
24794769 15 is => 'ro',
fb105cfa 16 required => 1,
17 handles => 'DBIx::Class::DeploymentHandler::HandlesVersionStorage',
24794769 18);
19
24794769 20has to_version => (
21 is => 'ro',
22 lazy_build => 1,
23);
24
25sub _build_to_version { $_[0]->schema->schema_version }
26
271;
28
29__END__
30
31# normally a VersionHandler will take
32# a to_version and yeild an iterator of
33# "version sets" or something like that.
34#
35# A "version set" is basically an arrayref
36# of "version numbers" (which we already know
37# is vague as is.) Typically an call to a
38# VH w/ a db version of 1 and a "to_version"
39# of 5 will iterate over something like this:
40# [1, 2]
41# [2, 3]
42# [3, 4]
43# [4, 5]
44#
45# Of course rob wants to be able to have dep
46# management with his versions, so I *think* his
47# would work like this:
48#
49# to_version = 7, db_version = 1
50# [1]
51# [5]
52# [7]
53#
54# Because 7 depended on 5, 5 was installed first;
55# note that this potentially never released module
56# doesn't use version pairs, instead it just yeilds
57# versions. Version pairs are too much work for users
58# to have to deal with in that sitation. We may
59# actually switch to this for other versioners.
60#
61# The upshot of all this is that the DeploymentMethod
62# needs to be able to take an ArrayRef[VersionNumber],
63# instead of just a pair of VersionNumber.
64vim: ts=2 sw=2 expandtab