[Bast-commits] r3534 - in trunk/DBIx-Class-Schema-Loader: . lib/DBIx/Class/Schema lib/DBIx/Class/Schema/Loader lib/DBIx/Class/Schema/Loader/DBI t

blblack at dev.catalyst.perl.org blblack at dev.catalyst.perl.org
Wed Jun 27 03:59:02 GMT 2007


Author: blblack
Date: 2007-06-27 03:59:01 +0100 (Wed, 27 Jun 2007)
New Revision: 3534

Modified:
   trunk/DBIx-Class-Schema-Loader/Changes
   trunk/DBIx-Class-Schema-Loader/lib/DBIx/Class/Schema/Loader.pm
   trunk/DBIx-Class-Schema-Loader/lib/DBIx/Class/Schema/Loader/Base.pm
   trunk/DBIx-Class-Schema-Loader/lib/DBIx/Class/Schema/Loader/DBI.pm
   trunk/DBIx-Class-Schema-Loader/lib/DBIx/Class/Schema/Loader/DBI/DB2.pm
   trunk/DBIx-Class-Schema-Loader/lib/DBIx/Class/Schema/Loader/DBI/Oracle.pm
   trunk/DBIx-Class-Schema-Loader/lib/DBIx/Class/Schema/Loader/DBI/Pg.pm
   trunk/DBIx-Class-Schema-Loader/lib/DBIx/Class/Schema/Loader/DBI/SQLite.pm
   trunk/DBIx-Class-Schema-Loader/lib/DBIx/Class/Schema/Loader/DBI/Writing.pm
   trunk/DBIx-Class-Schema-Loader/lib/DBIx/Class/Schema/Loader/DBI/mysql.pm
   trunk/DBIx-Class-Schema-Loader/lib/DBIx/Class/Schema/Loader/RelBuilder.pm
   trunk/DBIx-Class-Schema-Loader/t/20invocations.t
   trunk/DBIx-Class-Schema-Loader/t/21misc_fatal.t
   trunk/DBIx-Class-Schema-Loader/t/22dump.t
   trunk/DBIx-Class-Schema-Loader/t/23dumpmore.t
Log:
0.04001, dump_overwrite -> really_erase_my_files

Modified: trunk/DBIx-Class-Schema-Loader/Changes
===================================================================
--- trunk/DBIx-Class-Schema-Loader/Changes	2007-06-26 22:59:21 UTC (rev 3533)
+++ trunk/DBIx-Class-Schema-Loader/Changes	2007-06-27 02:59:01 UTC (rev 3534)
@@ -1,5 +1,12 @@
 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.

Modified: trunk/DBIx-Class-Schema-Loader/lib/DBIx/Class/Schema/Loader/Base.pm
===================================================================
--- trunk/DBIx-Class-Schema-Loader/lib/DBIx/Class/Schema/Loader/Base.pm	2007-06-26 22:59:21 UTC (rev 3533)
+++ trunk/DBIx-Class-Schema-Loader/lib/DBIx/Class/Schema/Loader/Base.pm	2007-06-27 02:59:01 UTC (rev 3534)
@@ -14,7 +14,7 @@
 use Digest::MD5 qw//;
 require DBIx::Class;
 
-our $VERSION = '0.04000';
+our $VERSION = '0.04001';
 
 __PACKAGE__->mk_ro_accessors(qw/
                                 schema
@@ -34,6 +34,7 @@
                                 debug
                                 dump_directory
                                 dump_overwrite
+                                really_erase_my_files
 
                                 db_schema
                                 _tables
@@ -162,6 +163,11 @@
 
 =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.
 
@@ -170,11 +176,15 @@
 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
@@ -225,6 +235,10 @@
     $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};
@@ -449,9 +463,9 @@
     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);
     }    
 
@@ -511,7 +525,7 @@
         }
     }
 
-    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;
 

Modified: trunk/DBIx-Class-Schema-Loader/lib/DBIx/Class/Schema/Loader/DBI/DB2.pm
===================================================================
--- trunk/DBIx-Class-Schema-Loader/lib/DBIx/Class/Schema/Loader/DBI/DB2.pm	2007-06-26 22:59:21 UTC (rev 3533)
+++ trunk/DBIx-Class-Schema-Loader/lib/DBIx/Class/Schema/Loader/DBI/DB2.pm	2007-06-27 02:59:01 UTC (rev 3534)
@@ -6,7 +6,7 @@
 use Carp::Clan qw/^DBIx::Class/;
 use Class::C3;
 
-our $VERSION = '0.04000';
+our $VERSION = '0.04001';
 
 =head1 NAME
 

Modified: trunk/DBIx-Class-Schema-Loader/lib/DBIx/Class/Schema/Loader/DBI/Oracle.pm
===================================================================
--- trunk/DBIx-Class-Schema-Loader/lib/DBIx/Class/Schema/Loader/DBI/Oracle.pm	2007-06-26 22:59:21 UTC (rev 3533)
+++ trunk/DBIx-Class-Schema-Loader/lib/DBIx/Class/Schema/Loader/DBI/Oracle.pm	2007-06-27 02:59:01 UTC (rev 3534)
@@ -6,7 +6,7 @@
 use Carp::Clan qw/^DBIx::Class/;
 use Class::C3;
 
-our $VERSION = '0.04000';
+our $VERSION = '0.04001';
 
 =head1 NAME
 

Modified: trunk/DBIx-Class-Schema-Loader/lib/DBIx/Class/Schema/Loader/DBI/Pg.pm
===================================================================
--- trunk/DBIx-Class-Schema-Loader/lib/DBIx/Class/Schema/Loader/DBI/Pg.pm	2007-06-26 22:59:21 UTC (rev 3533)
+++ trunk/DBIx-Class-Schema-Loader/lib/DBIx/Class/Schema/Loader/DBI/Pg.pm	2007-06-27 02:59:01 UTC (rev 3534)
@@ -6,7 +6,7 @@
 use Carp::Clan qw/^DBIx::Class/;
 use Class::C3;
 
-our $VERSION = '0.04000';
+our $VERSION = '0.04001';
 
 =head1 NAME
 

Modified: trunk/DBIx-Class-Schema-Loader/lib/DBIx/Class/Schema/Loader/DBI/SQLite.pm
===================================================================
--- trunk/DBIx-Class-Schema-Loader/lib/DBIx/Class/Schema/Loader/DBI/SQLite.pm	2007-06-26 22:59:21 UTC (rev 3533)
+++ trunk/DBIx-Class-Schema-Loader/lib/DBIx/Class/Schema/Loader/DBI/SQLite.pm	2007-06-27 02:59:01 UTC (rev 3534)
@@ -7,7 +7,7 @@
 use Text::Balanced qw( extract_bracketed );
 use Class::C3;
 
-our $VERSION = '0.04000';
+our $VERSION = '0.04001';
 
 =head1 NAME
 

Modified: trunk/DBIx-Class-Schema-Loader/lib/DBIx/Class/Schema/Loader/DBI/Writing.pm
===================================================================
--- trunk/DBIx-Class-Schema-Loader/lib/DBIx/Class/Schema/Loader/DBI/Writing.pm	2007-06-26 22:59:21 UTC (rev 3533)
+++ trunk/DBIx-Class-Schema-Loader/lib/DBIx/Class/Schema/Loader/DBI/Writing.pm	2007-06-27 02:59:01 UTC (rev 3534)
@@ -1,7 +1,7 @@
 package DBIx::Class::Schema::Loader::DBI::Writing;
 use strict;
 
-our $VERSION = '0.04000';
+our $VERSION = '0.04001';
 
 # Empty. POD only.
 

Modified: trunk/DBIx-Class-Schema-Loader/lib/DBIx/Class/Schema/Loader/DBI/mysql.pm
===================================================================
--- trunk/DBIx-Class-Schema-Loader/lib/DBIx/Class/Schema/Loader/DBI/mysql.pm	2007-06-26 22:59:21 UTC (rev 3533)
+++ trunk/DBIx-Class-Schema-Loader/lib/DBIx/Class/Schema/Loader/DBI/mysql.pm	2007-06-27 02:59:01 UTC (rev 3534)
@@ -6,7 +6,7 @@
 use Carp::Clan qw/^DBIx::Class/;
 use Class::C3;
 
-our $VERSION = '0.04000';
+our $VERSION = '0.04001';
 
 =head1 NAME
 

Modified: trunk/DBIx-Class-Schema-Loader/lib/DBIx/Class/Schema/Loader/DBI.pm
===================================================================
--- trunk/DBIx-Class-Schema-Loader/lib/DBIx/Class/Schema/Loader/DBI.pm	2007-06-26 22:59:21 UTC (rev 3533)
+++ trunk/DBIx-Class-Schema-Loader/lib/DBIx/Class/Schema/Loader/DBI.pm	2007-06-27 02:59:01 UTC (rev 3534)
@@ -7,7 +7,7 @@
 use Carp::Clan qw/^DBIx::Class/;
 use UNIVERSAL::require;
 
-our $VERSION = '0.04000';
+our $VERSION = '0.04001';
 
 =head1 NAME
 

Modified: trunk/DBIx-Class-Schema-Loader/lib/DBIx/Class/Schema/Loader/RelBuilder.pm
===================================================================
--- trunk/DBIx-Class-Schema-Loader/lib/DBIx/Class/Schema/Loader/RelBuilder.pm	2007-06-26 22:59:21 UTC (rev 3533)
+++ trunk/DBIx-Class-Schema-Loader/lib/DBIx/Class/Schema/Loader/RelBuilder.pm	2007-06-27 02:59:01 UTC (rev 3534)
@@ -5,7 +5,7 @@
 use Carp::Clan qw/^DBIx::Class/;
 use Lingua::EN::Inflect::Number ();
 
-our $VERSION = '0.04000';
+our $VERSION = '0.04001';
 
 =head1 NAME
 

Modified: trunk/DBIx-Class-Schema-Loader/lib/DBIx/Class/Schema/Loader.pm
===================================================================
--- trunk/DBIx-Class-Schema-Loader/lib/DBIx/Class/Schema/Loader.pm	2007-06-26 22:59:21 UTC (rev 3533)
+++ trunk/DBIx-Class-Schema-Loader/lib/DBIx/Class/Schema/Loader.pm	2007-06-27 02:59:01 UTC (rev 3534)
@@ -11,7 +11,7 @@
 # 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/);

Modified: trunk/DBIx-Class-Schema-Loader/t/20invocations.t
===================================================================
--- trunk/DBIx-Class-Schema-Loader/t/20invocations.t	2007-06-26 22:59:21 UTC (rev 3533)
+++ trunk/DBIx-Class-Schema-Loader/t/20invocations.t	2007-06-27 02:59:01 UTC (rev 3534)
@@ -37,7 +37,7 @@
         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;
@@ -47,7 +47,7 @@
         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 {
@@ -57,7 +57,7 @@
             $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 {
@@ -67,7 +67,7 @@
             { },
             [
                 $make_dbictest_db::dsn,
-                { loader_options => { dump_overwrite => 1 } },
+                { loader_options => { really_erase_my_files => 1 } },
             ],
         );
         "DBICTest::Schema::10";
@@ -75,7 +75,7 @@
     '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 }
@@ -85,7 +85,7 @@
         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;

Modified: trunk/DBIx-Class-Schema-Loader/t/21misc_fatal.t
===================================================================
--- trunk/DBIx-Class-Schema-Loader/t/21misc_fatal.t	2007-06-26 22:59:21 UTC (rev 3533)
+++ trunk/DBIx-Class-Schema-Loader/t/21misc_fatal.t	2007-06-27 02:59:01 UTC (rev 3534)
@@ -12,7 +12,7 @@
 
     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' );
 }
 

Modified: trunk/DBIx-Class-Schema-Loader/t/22dump.t
===================================================================
--- trunk/DBIx-Class-Schema-Loader/t/22dump.t	2007-06-26 22:59:21 UTC (rev 3533)
+++ trunk/DBIx-Class-Schema-Loader/t/22dump.t	2007-06-27 02:59:01 UTC (rev 3534)
@@ -19,7 +19,7 @@
     use base qw/ DBIx::Class::Schema::Loader /;
     __PACKAGE__->loader_options(
         dump_directory => $dump_path,
-        dump_overwrite => 1,
+        really_erase_my_files => 1,
     );
 }
 

Modified: trunk/DBIx-Class-Schema-Loader/t/23dumpmore.t
===================================================================
--- trunk/DBIx-Class-Schema-Loader/t/23dumpmore.t	2007-06-26 22:59:21 UTC (rev 3533)
+++ trunk/DBIx-Class-Schema-Loader/t/23dumpmore.t	2007-06-27 02:59:01 UTC (rev 3534)
@@ -138,7 +138,7 @@
 
 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 /,




More information about the Bast-commits mailing list