tiny bits of cleanup
[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 =method delete_database_version
37
38  $dh->delete_database_version({ version => '1.02' })
39
40 simply deletes given database version from the version storage
41
42 =method version_storage_is_installed
43
44  warn q(I can't version this database!)
45    unless $dh->version_storage_is_installed
46
47 return true iff the version storage is installed.
48
49 =head1 KNOWN IMPLEMENTATIONS
50
51 =over
52
53 =item *
54
55 L<DBIx::Class::DeploymentHandler::VersionStorage::Standard>
56
57 =item *
58
59 L<DBIx::Class::DeploymentHandler::VersionStorage::Deprecated>
60
61 =back
62