require DBIx::Class::ResultSet; # loaded for type constraint
use Carp::Clan '^DBIx::Class::DeploymentHandler';
-with 'DBIx::Class::DeploymentHandler::WithSqltDeployMethod';
-with 'DBIx::Class::DeploymentHandler::WithDatabaseToSchemaVersions';
+with 'DBIx::Class::DeploymentHandler::WithSqltDeployMethod',
+ 'DBIx::Class::DeploymentHandler::WithDatabaseToSchemaVersions',
+ 'DBIx::Class::DeploymentHandler::WithStandardVersionStorage';
BEGIN {
use Moose::Util::TypeConstraints;
predicate => 'has_backup_directory',
);
-has version_rs => (
- isa => 'DBIx::Class::ResultSet',
- is => 'ro',
- lazy_build => 1, # builder comes from another role...
- # which is... probably not how we want it
- handles => [qw( is_installed )],
-);
-
has to_version => ( # configuration
is => 'ro',
lazy_build => 1, # builder comes from another role...
method install {
carp 'Install not possible as versions table already exists in database'
- if $self->is_installed;
+ if $self->version_storage_is_installed;
my $new_version = $self->to_version;
if ($new_version) {
$self->_deploy;
- $self->version_rs->create({
+ $self->add_database_version({
version => $new_version,
# ddl => $ddl,
# upgrade_sql => $upgrade_sql,
while ( my $version_list = $self->next_version_set ) {
$self->_upgrade_single_step($version_list);
- $self->version_rs->create({
+ $self->add_database_version({
version => $version_list->[-1],
# ddl => $ddl,
# upgrade_sql => $upgrade_sql,