Skip Menu |

This queue is for tickets about the DBIx-Class-TimeStamp CPAN distribution.

Report information
The Basics
Id: 26081
Status: resolved
Priority: 0/
Queue: DBIx-Class-TimeStamp

People
Owner: jshirley+cpan [...] gmail.com
Requestors: INVINITY [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in:
  • 0.02
  • 0.01
Fixed in: 0.03



Subject: Datetime field recognition
In the method DBIx::Class::TimeStamp->add_columns when checking for the appropriate data_type of the column the following regex is used. /^(datetime|date|timestamp)$/ I was having problems getting the module to function properly until I looked at this code and realized that my data_type assignments in all my Class->add_columns calls are in uppercase. Such as: __PACKAGE__->add_columns( "created_at", { data_type => "DATETIME", # <- UPPERCASE doesn't work default_value => "0000-00-00 00:00:00", is_nullable => 0, size => 19, set_on_create => 1, }); Apparently, this case of the data_type value is carried through, therefore causing the regex filter to ignore the column. When I changed my data_type value to be lowercase, it worked. __PACKAGE__->add_columns( "created_at", { data_type => "datetime", # This works! default_value => "0000-00-00 00:00:00", is_nullable => 0, size => 19, set_on_create => 1, }); The data_type recognition filter should do some case conversion. Also, worth mentioning is that most all of my DBIx class files are generated using DBIx::Class::SchemaLoader and have the data_type declared in uppercase. Thanks so much for a convenient and easy module. perl: v5.8.8 os: Kubuntu Edgy 6.10 (2.6.17-11-generic) v/r -Matt Pitts
From: jshirley [...] gmail.com
On Tue Apr 03 19:52:02 2007, invinity wrote: Show quoted text
> In the method DBIx::Class::TimeStamp->add_columns when checking for the > appropriate data_type of the column the following regex is used. > > /^(datetime|date|timestamp)$/ > > I was having problems getting the module to function properly until I > looked at this code and realized that my data_type assignments in all my > Class->add_columns calls are in uppercase. Such as: > > __PACKAGE__->add_columns( > "created_at", > { > data_type => "DATETIME", # <- UPPERCASE doesn't work > default_value => "0000-00-00 00:00:00", > is_nullable => 0, > size => 19, > set_on_create => 1, > }); > > Apparently, this case of the data_type value is carried through, > therefore causing the regex filter to ignore the column. When I changed > my data_type value to be lowercase, it worked. > > __PACKAGE__->add_columns( > "created_at", > { > data_type => "datetime", # This works! > default_value => "0000-00-00 00:00:00", > is_nullable => 0, > size => 19, > set_on_create => 1, > }); > > The data_type recognition filter should do some case conversion. > > Also, worth mentioning is that most all of my DBIx class files are > generated using DBIx::Class::SchemaLoader and have the data_type > declared in uppercase. > > Thanks so much for a convenient and easy module. > > perl: v5.8.8 > os: Kubuntu Edgy 6.10 (2.6.17-11-generic) > > v/r > > -Matt Pitts
Hi Matt, I've just fixed this in SVN, and I'll work on getting a version bump out the door soon. Thanks for the bug report. SVN repository for this module is: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class-TimeStamp Thanks! -Jay
From: matt [...] gopitts.net
On Tue Apr 03 20:24:01 2007, JSHIRLEY wrote: Show quoted text
> > On Tue Apr 03 19:52:02 2007, invinity wrote:
> > In the method DBIx::Class::TimeStamp->add_columns when checking for the > > appropriate data_type of the column the following regex is used. > > > > /^(datetime|date|timestamp)$/ > > > > I was having problems getting the module to function properly until I > > looked at this code and realized that my data_type assignments in all my > > Class->add_columns calls are in uppercase. Such as: > > > > __PACKAGE__->add_columns( > > "created_at", > > { > > data_type => "DATETIME", # <- UPPERCASE doesn't work > > default_value => "0000-00-00 00:00:00", > > is_nullable => 0, > > size => 19, > > set_on_create => 1, > > }); > > > > Apparently, this case of the data_type value is carried through, > > therefore causing the regex filter to ignore the column. When I changed > > my data_type value to be lowercase, it worked. > > > > __PACKAGE__->add_columns( > > "created_at", > > { > > data_type => "datetime", # This works! > > default_value => "0000-00-00 00:00:00", > > is_nullable => 0, > > size => 19, > > set_on_create => 1, > > }); > > > > The data_type recognition filter should do some case conversion. > > > > Also, worth mentioning is that most all of my DBIx class files are > > generated using DBIx::Class::SchemaLoader and have the data_type > > declared in uppercase. > > > > Thanks so much for a convenient and easy module. > > > > perl: v5.8.8 > > os: Kubuntu Edgy 6.10 (2.6.17-11-generic) > > > > v/r > > > > -Matt Pitts
> > Hi Matt, > > I've just fixed this in SVN, and I'll work on getting a version bump out > the door soon. Thanks for the bug report. > > SVN repository for this module is: > http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class-TimeStamp > > Thanks! > > -Jay
Thanks for the quick response!