__PACKAGE__->mk_classdata('_filedata');
__PACKAGE__->mk_classdata('upgrade_directory');
+__PACKAGE__->mk_classdata('backup_directory');
sub on_connect
{
{
my ($self) = @_;
## Make each ::DBI::Foo do this
- $self->storage->backup();
+ $self->storage->backup($self->backup_directory());
}
sub upgrade
__PACKAGE__->load_components(qw/+DBIx::Class::Schema::Versioned/);
__PACKAGE__->upgrade_directory('/path/to/upgrades/');
+ __PACKAGE__->backup_directory('/path/to/backups/');
sub backup
{
path between the two versions supplied. By default, every change in
your VERSION is regarded as needing an upgrade.
+The actual upgrade is called manually by calling C<upgrade> on your
+schema object. Code is run at connect time to determine whether an
+upgrade is needed, if so, a warning "Versions out of sync" is
+produced.
+
NB: At the moment, SQLite upgrading is rather spotty, as SQL::Translator::Diff
returns SQL statements that SQLite does not support.
C<upgrade> method, running whichever commands you specify via the
regex in the parameter.
+=head2 upgrade_directory
+
+Use this to set the directory your upgrade files are stored in.
+
+=head2 backup_directory
+
+Use this to set the directory you want your backups stored in.
+
=head1 AUTHOR
Jess Robinson <castaway@desert-island.demon.co.uk>