Revision history for Perl extension DBIx::Class::Schema::Loader
+0.04001 Tue Jun 26, 2007
+ - Deprecated dump_overwrite. The changed behavior from
+ 0.03xxx was confusing.
+ - Added new option really_erase_my_files, which does what
+ dump_overwrite did in 0.04000, which is not what it did
+ in 0.03xxx.
+
0.04000 Thu Jun 7, 2007
- Added some env vars for controlling the Makefile.PL feature
questions, to make automation easier.
# Always remember to do all digits for the version even if they're 0
# i.e. first release of 0.XX *must* be 0.XX000. This avoids fBSD ports
# brain damage and presumably various other packaging systems too
-our $VERSION = '0.04000';
+our $VERSION = '0.04001';
__PACKAGE__->mk_classaccessor('_loader_args' => {});
__PACKAGE__->mk_classaccessors(qw/dump_to_dir _loader_invoked _loader/);
use Digest::MD5 qw//;
require DBIx::Class;
-our $VERSION = '0.04000';
+our $VERSION = '0.04001';
__PACKAGE__->mk_ro_accessors(qw/
schema
debug
dump_directory
dump_overwrite
+ really_erase_my_files
db_schema
_tables
=head2 dump_overwrite
+Deprecated. See L</really_erase_my_files> below, which does *not* mean
+the same thing as the old C<dump_overwrite> setting from previous releases.
+
+=head2 really_erase_my_files
+
Default false. If true, Loader will unconditionally delete any existing
files before creating the new ones from scratch when dumping a schema to disk.
C<# DO NOT MODIFY THIS OR ANYTHING ABOVE!>
leaving any customizations you placed after that as they were.
-When C<dump_overwrite> is not set, if the output file already exists,
+When C<really_erase_my_files> is not set, if the output file already exists,
but the aforementioned final stanza is not found, or the checksum
contained there does not match the generated contents, Loader will
croak and not touch the file.
+You should really be using version control on your schema classes (and all
+of the rest of your code for that matter). Don't blame me if a bug in this
+code wipes something out when it shouldn't have, you've been warned.
+
=head1 METHODS
None of these methods are intended for direct invocation by regular
$self->{schema_class} ||= ( ref $self->{schema} || $self->{schema} );
$self->{schema} ||= $self->{schema_class};
+ croak "dump_overwrite is deprecated. Please read the"
+ . " DBIx::Class::Schema::Loader::Base documentation"
+ if $self->{dump_overwrite};
+
$self->{relbuilder} = DBIx::Class::Schema::Loader::RelBuilder->new(
$self->schema_class, $self->inflect_plural, $self->inflect_singular
) if !$self->{skip_relationships};
my $filename = $self->_get_dump_filename($class);
$self->_ensure_dump_subdirs($class);
- if (-f $filename && $self->dump_overwrite) {
+ if (-f $filename && $self->really_erase_my_files) {
warn "Deleting existing file '$filename' due to "
- . "'dump_overwrite' setting\n";
+ . "'really_erase_my_files' setting\n";
unlink($filename);
}
}
}
- croak "Cannot not overwrite '$filename' without 'dump_overwrite',"
+ croak "Cannot not overwrite '$filename' without 'really_erase_my_files',"
. " it does not appear to have been generated by Loader"
if !$found;
use Carp::Clan qw/^DBIx::Class/;
use UNIVERSAL::require;
-our $VERSION = '0.04000';
+our $VERSION = '0.04001';
=head1 NAME
use Carp::Clan qw/^DBIx::Class/;
use Class::C3;
-our $VERSION = '0.04000';
+our $VERSION = '0.04001';
=head1 NAME
use Carp::Clan qw/^DBIx::Class/;
use Class::C3;
-our $VERSION = '0.04000';
+our $VERSION = '0.04001';
=head1 NAME
use Carp::Clan qw/^DBIx::Class/;
use Class::C3;
-our $VERSION = '0.04000';
+our $VERSION = '0.04001';
=head1 NAME
use Text::Balanced qw( extract_bracketed );
use Class::C3;
-our $VERSION = '0.04000';
+our $VERSION = '0.04001';
=head1 NAME
package DBIx::Class::Schema::Loader::DBI::Writing;
use strict;
-our $VERSION = '0.04000';
+our $VERSION = '0.04001';
# Empty. POD only.
use Carp::Clan qw/^DBIx::Class/;
use Class::C3;
-our $VERSION = '0.04000';
+our $VERSION = '0.04001';
=head1 NAME
use Carp::Clan qw/^DBIx::Class/;
use Lingua::EN::Inflect::Number ();
-our $VERSION = '0.04000';
+our $VERSION = '0.04001';
=head1 NAME
use DBIx::Class::Schema::Loader qw/ make_schema_at /;
make_schema_at(
'DBICTest::Schema::7',
- { dump_overwrite => 1 },
+ { really_erase_my_files => 1 },
[ $make_dbictest_db::dsn ],
);
DBICTest::Schema::7->clone;
use base qw/ DBIx::Class::Schema::Loader /;
__PACKAGE__->connect(
$make_dbictest_db::dsn,
- { loader_options => { dump_overwrite => 1 } }
+ { loader_options => { really_erase_my_files => 1 } }
);
},
'embedded_options_in_attrs' => sub {
$make_dbictest_db::dsn,
undef,
undef,
- { AutoCommit => 1, loader_options => { dump_overwrite => 1 } }
+ { AutoCommit => 1, loader_options => { really_erase_my_files => 1 } }
);
},
'embedded_options_make_schema_at' => sub {
{ },
[
$make_dbictest_db::dsn,
- { loader_options => { dump_overwrite => 1 } },
+ { loader_options => { really_erase_my_files => 1 } },
],
);
"DBICTest::Schema::10";
'almost_embedded' => sub {
package DBICTest::Schema::11;
use base qw/ DBIx::Class::Schema::Loader /;
- __PACKAGE__->loader_options( dump_overwrite => 1 );
+ __PACKAGE__->loader_options( really_erase_my_files => 1 );
__PACKAGE__->connect(
$make_dbictest_db::dsn,
undef, undef, { AutoCommit => 1 }
use DBIx::Class::Schema::Loader;
DBIx::Class::Schema::Loader::make_schema_at(
'DBICTest::Schema::12',
- { dump_overwrite => 1 },
+ { really_erase_my_files => 1 },
[ $make_dbictest_db::dsn ],
);
DBICTest::Schema::12->clone;
package DBICTest::Schema;
use base qw/ DBIx::Class::Schema::Loader /;
- __PACKAGE__->loader_options( dump_overwrite => 1 );
+ __PACKAGE__->loader_options( really_erase_my_files => 1 );
__PACKAGE__->storage_type( '::xyzzy' );
}
use base qw/ DBIx::Class::Schema::Loader /;
__PACKAGE__->loader_options(
dump_directory => $dump_path,
- dump_overwrite => 1,
+ really_erase_my_files => 1,
);
}
do_dump_test(
classname => 'DBICTest::DumpMore::1',
- options => { dump_overwrite => 1 },
+ options => { really_erase_my_files => 1 },
error => '',
warnings => [
qr/Dumping manual schema for DBICTest::DumpMore::1 to directory /,