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