[Bast-commits] r4213 - in DBIx-Class/0.08/trunk: .
lib/DBIx/Class/Storage lib/SQL/Translator/Parser/DBIx
ash at dev.catalyst.perl.org
ash at dev.catalyst.perl.org
Mon Mar 17 21:46:07 GMT 2008
Author: ash
Date: 2008-03-17 21:46:07 +0000 (Mon, 17 Mar 2008)
New Revision: 4213
Modified:
DBIx-Class/0.08/trunk/Changes
DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI.pm
DBIx-Class/0.08/trunk/lib/SQL/Translator/Parser/DBIx/Class.pm
Log:
Fix is_deferrable and respcet sqltargs properly
Modified: DBIx-Class/0.08/trunk/Changes
===================================================================
--- DBIx-Class/0.08/trunk/Changes 2008-03-15 07:13:01 UTC (rev 4212)
+++ DBIx-Class/0.08/trunk/Changes 2008-03-17 21:46:07 UTC (rev 4213)
@@ -4,6 +4,7 @@
parser (Anders Nor Berle)
- Refactored DBIx::Class::Schema::Versioned
- Syntax errors from resultset components are now reported correctly
+ - sqltargs respected correctly in deploy et al.
0.08010 2008-03-01 10:30
- Fix t/94versioning.t so it passes with latest SQL::Translator
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI.pm 2008-03-15 07:13:01 UTC (rev 4212)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI.pm 2008-03-17 21:46:07 UTC (rev 4213)
@@ -1353,9 +1353,7 @@
. $self->_check_sqlt_message . q{'})
if !$self->_check_sqlt_version;
- my $sqlt = SQL::Translator->new({
- add_drop_table => 1,
- });
+ my $sqlt = SQL::Translator->new( $sqltargs );
$sqlt->parser('SQL::Translator::Parser::DBIx::Class');
my $sqlt_schema = $sqlt->translate({ data => $schema }) or die $sqlt->error;
@@ -1410,10 +1408,11 @@
my $source_schema;
{
- my $t = SQL::Translator->new;
+ my $t = SQL::Translator->new($sqltargs);
$t->debug( 0 );
$t->trace( 0 );
$t->parser( $db ) or die $t->error;
+ $t = $self->configure_sqlt($t, $db);
my $out = $t->translate( $prefilename ) or die $t->error;
$source_schema = $t->schema;
unless ( $source_schema->name ) {
@@ -1427,10 +1426,11 @@
my $dest_schema = $sqlt_schema;
unless ( "SQL::Translator::Producer::$db"->can('preprocess_schema') ) {
- my $t = SQL::Translator->new;
+ my $t = SQL::Translator->new($sqltargs);
$t->debug( 0 );
$t->trace( 0 );
$t->parser( $db ) or die $t->error;
+ $t = $self->configure_sqlt($t, $db);
my $out = $t->translate( $filename ) or die $t->error;
$dest_schema = $t->schema;
$dest_schema->name( $filename )
@@ -1439,7 +1439,7 @@
my $diff = SQL::Translator::Diff::schema_diff($source_schema, $db,
$dest_schema, $db,
- {}
+ $sqltargs
);
if(!open $file, ">$difffile")
{
Modified: DBIx-Class/0.08/trunk/lib/SQL/Translator/Parser/DBIx/Class.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/SQL/Translator/Parser/DBIx/Class.pm 2008-03-15 07:13:01 UTC (rev 4212)
+++ DBIx-Class/0.08/trunk/lib/SQL/Translator/Parser/DBIx/Class.pm 2008-03-17 21:46:07 UTC (rev 4213)
@@ -153,7 +153,7 @@
$on_update = $otherrelationship->{'attrs'}->{cascade_copy} ? 'CASCADE' : '';
}
- my $is_deferrable = $rel_info->{attrs}{is_deferrable} || 0;
+ my $is_deferrable = $rel_info->{attrs}{is_deferrable};
# Make sure we dont create the same foreign key constraint twice
my $key_test = join("\x00", @keys);
@@ -185,7 +185,7 @@
reference_table => $rel_table,
on_delete => $on_delete,
on_update => $on_update,
- deferrable => $is_deferrable,
+ defined $is_deferrable ? ( deferrable => $is_deferrable ) : (),
);
my $index = $table->add_index(
More information about the Bast-commits
mailing list