From: <oli...@t-...> - 2011-10-17 20:39:34
|
On 2011-10-17, Germán <ger...@ya...> wrote: > > Alejandro patch(parse_diagram.patch) solves the same problem as > that of ftdebugger. Likewise, I do not have the necessary knowledge > on the code to decide what is the best solution. Okay. I looked again at Alejandro's parse_diagram.patch and I think it is redundant to ftdebugger's patch. > if you used the patch of Ftdebugger, you can continue applying the patch > from Alejandro to make use of the feature "surrogate > keys"(generate_code_sql.patch). Okay, I did that: RCS file: /cvsroot/dia2code/dia2code/dia2code/generate_code_sql.c,v ---------------------------- revision 1.5 date: 2011/10/17 20:26:54; author: okellogg; state: Exp; lines: +24 -1 Apply generate_code_sql.patch by Alejandro Imass, see > [...] > 3) In generate_code_sql.c you are assuming that the FK columns have > the same name on both sides (which is not very common), and with with > the advent and ever-popular use of ORM technologies such as Propel > (PHP) and DBIx::Class (Perl) the current naming convention/trend is to > work with simple serial "surrogate keys", and FKs are 'standardized' > to the form xxx_id where xxx is the FK table and the FK is _always_ > "id". So in the attached patch, I check for this convention and warn > if not being used. ---------------------------- > And finally, you can apply the patch > that fixes the problem I found. Yes, I did that also in generate_code_sql.c revision 1.5 Hope this helps, Oliver |