lots more doc
[dbsrgits/DBIx-Class-DeploymentHandler.git] / lib / DBIx / Class / DeploymentHandler / HandlesVersionStorage.pm
1 package DBIx::Class::DeploymentHandler::HandlesVersionStorage;
2 use Moose::Role;
3
4 requires 'add_database_version';
5 requires 'database_version';
6 requires 'delete_database_version';
7 requires 'version_storage_is_installed';
8
9 1;
10
11
12 =head1 DESCRIPTION
13
14 Typically VersionStorages will be implemented with a simple
15 DBIx::Class::Result.  Take a look at the
16 L<two existing implementations|/KNOWN IMPLEMENTATIONS> for examples of what you
17 might want to do in your own storage.
18
19 =method add_database_version
20
21  $dh->add_database_version({
22    version     => '1.02',
23    ddl         => $ddl # can be undef,
24    upgrade_sql => $sql # can be undef,
25  });
26
27 Store a new version into the version storage
28
29 =method database_version
30
31  my $db_version = $version_storage->database_version;
32
33 =method delete_database_version
34
35  $dh->delete_database_version({ version => '1.02' })
36
37 simply deletes given database version from the version storage
38
39 =method version_storage_is_installed
40
41  warn q(I can't version this database!)
42    unless $dh->version_storage_is_installed
43
44 return true iff the version storage is installed.
45
46 =head1 KNOWN IMPLEMENTATIONS
47
48 =over
49
50 =item *
51
52 L<DBIx::Class::DeploymentHandler::VersionStorage::Standard>
53
54 =item *
55
56 L<DBIx::Class::DeploymentHandler::VersionStorage::Deprecated>
57
58 =back
59
60 __END__
61
62 vim: ts=2 sw=2 expandtab