Skip Menu |

This queue is for tickets about the SQL-Translator CPAN distribution.

Report information
The Basics
Id: 50568
Status: resolved
Priority: 0/
Queue: SQL-Translator

People
Owner: Nobody in particular
Requestors: stephan [...] stejau.de
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.11003
Fixed in: 0.11011



Subject: Patch to prevent PostgreSQL Producer from dropping nameless Constraints
Hi, I attached an patch which prevents PostgreSQL Producer from deleting nameless Constraints and thous generating Invalid SQL. Sincerly, Stephan 'stephan48' Jauernick
Subject: pg_dont_drop_nameless_constraints.patch
851a852,854 > > return unless $c->name; >
I attached the same patch again but generated with diff -u :)
--- lib/SQL/Translator/Producer/PostgreSQL.pm 2009-10-03 20:08:31.000000000 +0200 +++ /home/linuxrulz/catalyst/LinuxRulz/lib/SQL/Translator/Producer/PostgreSQL.pm 2009-10-16 17:29:16.000000000 +0200 @@ -849,6 +849,9 @@ my ($c, $options) = @_; my $qt = $options->{quote_table_names} || ''; my $qc = $options->{quote_field_names} || ''; + + return unless $c->name; + my $out = sprintf('ALTER TABLE %s DROP CONSTRAINT %s', $qt . $c->table->name . $qt, $qc . $c->name . $qc );
This has been solved in a much more elegant way by c50d1a0afe9acf17c421acdfae25cf050b1da92e. Cheers!