Revision history for {{$dist->name}}
{{$NEXT}}
+ - upgrade_directory is wrong and vague, instead we use script_directory
- stricter validation (no undef) on versions to prevent weird surprises
- change method args to named args
- document method args
class_name => 'DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator',
delegate_name => 'deploy_method',
attributes_to_assume => ['schema'],
- attributes_to_copy => [qw( databases upgrade_directory sql_translator_args )],
+ attributes_to_copy => [qw( databases script_directory sql_translator_args )],
},
'DBIx::Class::DeploymentHandler::WithApplicatorDumple' => {
interface_role => 'DBIx::Class::DeploymentHandler::HandlesVersioning',
class_name => 'DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator',
delegate_name => 'deploy_method',
attributes_to_assume => ['schema'],
- attributes_to_copy => [qw( databases upgrade_directory sql_translator_args )],
+ attributes_to_copy => [qw( databases script_directory sql_translator_args )],
},
'DBIx::Class::DeploymentHandler::WithApplicatorDumple' => {
interface_role => 'DBIx::Class::DeploymentHandler::HandlesVersioning',
is => 'ro',
default => sub { {} },
);
-has upgrade_directory => (
+has script_directory => (
isa => 'Str',
is => 'ro',
required => 1,
method _build_schema_version { $self->schema->schema_version }
method __ddl_consume_with_prefix($type, $versions, $prefix) {
- my $base_dir = $self->upgrade_directory;
+ my $base_dir = $self->script_directory;
my $main = catfile( $base_dir, $type );
my $generic = catfile( $base_dir, '_generic' );
}
method _ddl_schema_produce_filename($type, $version) {
- my $dirname = catfile( $self->upgrade_directory, $type, 'schema', $version );
+ my $dirname = catfile( $self->script_directory, $type, 'schema', $version );
mkpath($dirname) unless -d $dirname;
return catfile( $dirname, '001-auto.sql' );
}
method _ddl_schema_up_produce_filename($type, $versions) {
- my $dir = $self->upgrade_directory;
+ my $dir = $self->script_directory;
my $dirname = catfile( $dir, $type, 'up', join q(-), @{$versions});
mkpath($dirname) unless -d $dirname;
my $to_file = shift;
my $schema = $self->schema;
my $databases = $self->databases;
- my $dir = $self->upgrade_directory;
+ my $dir = $self->script_directory;
my $version = $self->schema_version;
my $sqlt = SQL::Translator->new({
my ($self, $source_name) = @_;
return sub {
my ($self, $type, $version) = @_;
- my $dirname = catfile( $self->upgrade_directory, $type, 'schema', $version );
+ my $dirname = catfile( $self->script_directory, $type, 'schema', $version );
mkpath($dirname) unless -d $dirname;
return catfile( $dirname, "001-auto-$source_name.sql" );
method _prepare_changegrade($from_version, $to_version, $version_set, $direction) {
my $schema = $self->schema;
my $databases = $self->databases;
- my $dir = $self->upgrade_directory;
+ my $dir = $self->script_directory;
my $sqltargs = $self->sql_translator_args;
my $schema_version = $self->schema_version;
The arguments that get passed to L<SQL::Translator> when it's used.
-=attr upgrade_directory
+=attr script_directory
-The directory (default C<'sql'>) that upgrades are stored in
+The directory (default C<'sql'>) that scripts are stored in
=attr databases
$filename =~ s/::/-/g;
$filename = catfile(
- $self->upgrade_directory, "$filename-$version-$type.sql"
+ $self->script_directory, "$filename-$version-$type.sql"
);
return $filename;
$filename =~ s/::/-/g;
$filename = catfile(
- $self->upgrade_directory, "$filename-" . join( q(-), @{$versions} ) . "-$type.sql"
+ $self->script_directory, "$filename-" . join( q(-), @{$versions} ) . "-$type.sql"
);
return $filename;
class_name => 'DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator::Deprecated',
delegate_name => 'deploy_method',
attributes_to_assume => ['schema'],
- attributes_to_copy => [qw( upgrade_directory databases sql_translator_args )],
+ attributes_to_copy => [qw( script_directory databases sql_translator_args )],
},
'DBIx::Class::DeploymentHandler::WithApplicatorDumple' => {
interface_role => 'DBIx::Class::DeploymentHandler::HandlesVersionStorage',
$DBICVersion::Schema::VERSION = 1;
ok($s, 'DBICVersion::Schema 1 instantiates correctly');
my $handler = DH->new({
- upgrade_directory => $sql_dir,
+ script_directory => $sql_dir,
schema => $s,
databases => 'SQLite',
sql_translator_args => { add_drop_table => 0 },
$DBICVersion::Schema::VERSION = 2;
ok($s, 'DBICVersion::Schema 2 instantiates correctly');
my $handler = DH->new({
- upgrade_directory => $sql_dir,
+ script_directory => $sql_dir,
schema => $s,
databases => 'SQLite',
});
$DBICVersion::Schema::VERSION = 3;
ok($s, 'DBICVersion::Schema 3 instantiates correctly');
my $handler = DH->new({
- upgrade_directory => $sql_dir,
+ script_directory => $sql_dir,
schema => $s,
databases => 'SQLite',
});
$DBICVersion::Schema::VERSION = 2;
ok($s, 'DBICVersion::Schema 2 instantiates correctly');
my $handler = DH->new({
- upgrade_directory => $sql_dir,
+ script_directory => $sql_dir,
schema => $s,
databases => 'SQLite',
});
$DBICVersion::Schema::VERSION = 1;
ok($s, 'DBICVersion::Schema 1 instantiates correctly');
my $handler = DH->new({
- upgrade_directory => $sql_dir,
+ script_directory => $sql_dir,
schema => $s,
databases => 'SQLite',
sql_translator_args => { add_drop_table => 0 },
$DBICVersion::Schema::VERSION = 2;
ok($s, 'DBICVersion::Schema 2 instantiates correctly');
my $handler = DH->new({
- upgrade_directory => $sql_dir,
+ script_directory => $sql_dir,
schema => $s,
databases => 'SQLite',
});
$DBICVersion::Schema::VERSION = 3;
ok($s, 'DBICVersion::Schema 3 instantiates correctly');
my $handler = DH->new({
- upgrade_directory => $sql_dir,
+ script_directory => $sql_dir,
schema => $s,
databases => 'SQLite',
});
$DBICVersion::Schema::VERSION = 2;
ok($s, 'DBICVersion::Schema 2 instantiates correctly');
my $handler = DH->new({
- upgrade_directory => $sql_dir,
+ script_directory => $sql_dir,
schema => $s,
databases => 'SQLite',
});
is $s->schema_version, '1.0', 'schema version is at 1.0';
ok($s, 'DBICVersion::Schema 1.0 instantiates correctly');
my $handler = Deprecated->new({
- upgrade_directory => $sql_dir,
+ script_directory => $sql_dir,
schema => $s,
databases => 'SQLite',
sql_translator_args => { add_drop_table => 0 },
is $s->schema_version, '2.0', 'schema version is at 2.0';
ok($s, 'DBICVersion::Schema 2.0 instantiates correctly');
my $handler = Deprecated->new({
- upgrade_directory => $sql_dir,
+ script_directory => $sql_dir,
schema => $s,
databases => 'SQLite',
});
is $s->schema_version, '3.0', 'schema version is at 3.0';
ok($s, 'DBICVersion::Schema 3.0 instantiates correctly');
my $handler = Deprecated->new({
- upgrade_directory => $sql_dir,
+ script_directory => $sql_dir,
schema => $s,
databases => 'SQLite',
});
ok($s, 'DBICVersion::Schema 1 instantiates correctly');
ok !$s->storage->connected, 'creating schema did not connect';
my $handler = DH->new({
- upgrade_directory => $sql_dir,
+ script_directory => $sql_dir,
schema => $s,
databases => 'SQLite',
sql_translator_args => { add_drop_table => 0 },
my $s = DBICVersion::Schema->connect(@connection);
my $dm = Translator->new({
schema => $s,
- upgrade_directory => $sql_dir,
+ script_directory => $sql_dir,
databases => ['SQLite'],
sql_translator_args => { add_drop_table => 0 },
});
my $s = DBICVersion::Schema->connect(@connection);
my $dm = Translator->new({
schema => $s,
- upgrade_directory => $sql_dir,
+ script_directory => $sql_dir,
databases => ['SQLite'],
sql_translator_args => { add_drop_table => 0 },
txn_wrap => 1,
my $s = DBICVersion::Schema->connect(@connection);
my $dm = Translator->new({
schema => $s,
- upgrade_directory => $sql_dir,
+ script_directory => $sql_dir,
databases => ['SQLite'],
sql_translator_args => { add_drop_table => 0 },
txn_wrap => 0,
my $s = DBICVersion::Schema->connect(@connection);
my $dm = Deprecated->new({
schema => $s,
- upgrade_directory => $sql_dir,
+ script_directory => $sql_dir,
databases => ['SQLite'],
sql_translator_args => { add_drop_table => 0 },
});
my $s = DBICVersion::Schema->connect(@connection);
my $dm = Deprecated->new({
schema => $s,
- upgrade_directory => $sql_dir,
+ script_directory => $sql_dir,
databases => ['SQLite'],
});
my $dm = Translator->new({
schema => $s,
- upgrade_directory => $sql_dir,
+ script_directory => $sql_dir,
databases => ['SQLite'],
sql_translator_args => { add_drop_table => 0 },
});