Subject: | timestamp - sqlite problem |
Hi,
I cannot give a default value to a timestamp in a sqlite db using
Rose::DB::Object.
I have the following table:
CREATE TABLE temperatures
(
sample_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
temperature_value DECIMAL,
);
the following object interface:
__PACKAGE__->meta->setup
(
table => 'temperatures',
columns =>
[
sample_time => { type => 'timestamp', not_null => 1, default =>
'CURRENT_TIMESTAMP' },
temperature_value => { type => 'decimal'},
],
primary_key_columns => [ 'sample_time' ],
);
and this code:
my $pTemperature = temperature->new(temperature_value => -273.15);
$pTemperature->save();
but when I SELECT sample_time FROM temperatures, the value of the field
is the string 'CURRENT_TIMESTAMP'.
I've also tried with
"default => 'now()'"
and with
"default => ''"
without success.