From: Ash Berlin Date: Fri, 30 May 2008 13:29:32 +0000 (+0000) Subject: Make ingore_{constraint,index}_names default X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d4d46d1913b15af0536c4135a652ebcec967fde0;p=dbsrgits%2FDBIx-Class-Historic.git Make ingore_{constraint,index}_names default --- diff --git a/Changes b/Changes index 67882d6..368e47d 100644 --- a/Changes +++ b/Changes @@ -16,7 +16,9 @@ Revision history for DBIx::Class - Improve handling of explicit key attr in ResultSet::find - Add warnings for non-unique ResultSet::find queries - Changed Storage::DBI::Replication to Storage::DBI::Replicated, fixed - some problems using this with versioned databases, added some docs + some problems using this with versioned databases, added some docs + - By default now deploy/diff et al. will ignore constraint and index + names 0.08010 2008-03-01 10:30 - Fix t/94versioning.t so it passes with latest SQL::Translator diff --git a/lib/DBIx/Class/Storage/DBI.pm b/lib/DBIx/Class/Storage/DBI.pm index 7d76be6..fbf0c8b 100644 --- a/lib/DBIx/Class/Storage/DBI.pm +++ b/lib/DBIx/Class/Storage/DBI.pm @@ -1453,7 +1453,12 @@ sub create_ddl_dir $databases ||= ['MySQL', 'SQLite', 'PostgreSQL']; $databases = [ $databases ] if(ref($databases) ne 'ARRAY'); $version ||= $schema->VERSION || '1.x'; - $sqltargs = { ( add_drop_table => 1 ), %{$sqltargs || {}} }; + $sqltargs = { + add_drop_table => 1, + ignore_constraint_names => 1, + ignore_index_names => 1, + %{$sqltargs || {}} + }; $self->throw_exception(q{Can't create a ddl file without SQL::Translator 0.09: '} . $self->_check_sqlt_message . q{'}) @@ -1543,7 +1548,6 @@ sub create_ddl_dir unless $dest_schema->name; } - $DB::single = 1; my $diff = SQL::Translator::Diff::schema_diff($source_schema, $db, $dest_schema, $db, $sqltargs