Revision history for {{$dist->name}}
{{$NEXT}}
+ - put schema_version attr in more places
0.001000_04 2010-04-27 13:29:14 CST6CDT
- schema_version is now an attr so that users can more easily force the
isa => 'DBIx::Class::Schema',
is => 'ro',
required => 1,
- handles => [qw( schema_version )],
);
has storage => (
default => 1,
);
+has schema_version => (
+ is => 'ro',
+ lazy_build => 1,
+);
+
+method _build_schema_version { $self->schema->schema_version }
+
method __ddl_consume_with_prefix($type, $versions, $prefix) {
my $base_dir = $self->upgrade_directory;
}
sub _prepare_install {
- my $self = shift;
+ my $self = shift;
my $sqltargs = { %{$self->sqltargs}, %{shift @_} };
my $to_file = shift;
my $schema = $self->schema;
my $databases = $self->databases;
my $dir = $self->upgrade_directory;
- my $version = $schema->schema_version;
+ my $version = $self->schema_version;
my $sqlt = SQL::Translator->new({
add_drop_table => 1,
my $dir = $self->upgrade_directory;
my $sqltargs = $self->sqltargs;
- my $schema_version = $schema->schema_version;
+ my $schema_version = $self->schema_version;
$sqltargs = {
add_drop_table => 1,
=attr sqltargs
-#rename
+TODO
+# rename
=attr upgrade_directory
Set to true (which is the default) to wrap all upgrades and deploys in a single
transaction.
+=attr schema_version
+
+The version the schema on your harddrive is at. Defaults to
+C<< $self->schema->schema_version >>.
+
=method __ddl_consume_with_prefix
$dm->__ddl_consume_with_prefix( 'SQLite', [qw( 1.00 1.01 )], 'up' )
sub _build_deploy_method {
my $self = shift;
- DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator->new({
+ my $args = {
schema => $self->schema,
databases => $self->databases,
upgrade_directory => $self->upgrade_directory,
sqltargs => $self->sqltargs,
- });
+ };
+
+ $args->{schema_version} = $self->schema_version if $self->has_schema_version;
+ DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator->new($args);
}
1;
# vim: ts=2 sw=2 expandtab
__END__
+
+TODO: pod