isa => 'DBIx::Class::Schema',
is => 'ro',
required => 1,
- handles => [qw( ddl_filename schema_version )],
);
has upgrade_directory => ( # configuration
has version_rs => (
isa => 'DBIx::Class::ResultSet',
is => 'ro',
- lazy_build => 1,
- handles => [qw( is_installed db_version )],
+ lazy_build => 1, # builder comes from another role...
+ # which is... probably not how we want it
+ handles => [qw( is_installed )],
);
-has to_version => (
+has to_version => ( # configuration
is => 'ro',
- lazy_build => 1,
+ lazy_build => 1, # builder comes from another role...
+ # which is... probably not how we want it
);
has databases => ( # configuration
}
}
+method backup { $self->storage->backup($self->backup_directory) }
+
__PACKAGE__->meta->make_immutable;
1;
$s
}
-has backup_directory => (
- isa => 'Str',
- is => 'ro',
-);
-
-has do_backup => (
- isa => 'Bool',
- is => 'ro',
- default => undef,
-);
-
has sqltargs => (
isa => 'HashRef',
is => 'ro',
carp "DB version ($db_version) is lower than the schema version (".$self->schema_version."). Attempting upgrade.\n";
$self->_filedata($self->_read_sql_file($upgrade_file)); # I don't like this --fREW 2010-02-22
- $self->backup if $self->do_backup;
$self->schema->txn_do(sub { $self->_do_upgrade });
$self->version_rs->create({
$self->storage->dbh->do($_) or carp "SQL was: $_"
}
-method backup { $self->storage->backup($self->backup_directory) }
-
__PACKAGE__->meta->make_immutable;
1;