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