Subject: | but he is not dead yet... |
From: | giorgos zervas <giorgos [...] perlfect.com> |
To: | bug-Tangram [...] rt.cpan.org |
Date: | 23 May 2003 10:41:38 +0000 |
Here is a bug.
A schema like that works fine...
fields =>
{
string => [ qw( firstName name ) ],
int => [ qw( age ) ],
ref => { partner => { null => 1 } },
array => { children => 'NaturalPerson' },
},
However something like:
fields =>
{
string => [ qw( firstName name ) ],
int => [ qw( age ) ],
ref => { partner => { null => 1 } },
array => { children => 'Natural::Person' }, # NOTICE
THE "::" HERE
},
produces SQL problems as it tries to create a column with "::" in its
name and mysql doesn't like that.
The way around that, that I have found, is:
fields =>
{
string => [ qw( firstName name ) ],
int => [ qw( age ) ],
ref => { partner => { null => 1 } },
array => { children => { class => 'Natural::Person'} },
},
i.e. using the long form of the specification.
My normalize function looks like:
sub normalize {
my ($name, $type) = @_;
$name =~ s/\:\://g;
return $name;
}
It seems that altough the normalize function is applied to table names
it is not applied to column names.
I hope my explanation is clear... I am using 2.04.
Best regards,
Giorgos