Subject: | bug ParseDiaSql |
Date: | Fri, 26 Feb 2010 11:29:33 -0500 |
To: | bug-Parse-Dia-SQL [...] rt.cpan.org |
From: | Alexis Barrera <barrera.alexis [...] gmail.com> |
Hi, thanks for your work. I knew about your script because i couldn't
generate the SQL code using tedi2sql with dia 0.97 files and parsediasql was
what i found in the web, so thanks for that, again.
The issue is this: I generate the SQL code from a dia (0.97) file, using the
UML interpretation. To do it i wrote the script, setting the uml variable to
true, no problem there, but when it generates the code, it gives a lot of
warnings when trying to create the foreign keys. I use PostgreSQL
definitions, so there's a lot of serial type attributes in referenced
tables, wich is different to the integer type the other table has.
I solved thi issue by editing the file 'Utils.pm' and installing the package
again. The change i did was to change the line 507:
if ( $pktype ne $fktype )
for this:
if ( $pktype ne $fktype and $self->{db} ne 'postgres' and $pktype eq
'SERIAL')
Which is the original behavior of tedia2sql. So i don't know if you consider
this a bug, but i think it's important to allow the creation of FKs in this
situation, because that's not actually an error in the data definition.
My system info:
- Script version: Parse-Dia-SQL-0.13_02 and Parse-Dia-SQL-0.14
- SO: Fedora 12 kernel 2.6.32.7-37.fc12.x86_64
- Perl version: 5.10.0
Thanks again. Keep up the good work.