Hi,
I have an SQLite table 'users' with a column like
email_validated BOOLEAN NOT NULL DEFAULT 0
(I know SQLite does not support boolean natively, but I like to use the create table definitions for other db's too).
When I do this
my $u = MyIMDB::Models::User->new(user_name => $user_name);
$u->load;
$u->{email_validated} = 1;
$u->save;
The column email_validated is not updated to 1.
I tried by adding a column type definition like
__PACKAGE__->meta->setup (
table => 'users',
unique_key => ['user_name', 'id'],
columns =>
[
email_validated => { type => 'boolean' },
],
auto => 1,
Funny thing is that when I do
my $u = MyIMDB::Models::User->new;
$u->{email_validated} = 1;
$u->save;
(so no load of existing row), the column email_validated is set to 1...
Why does the ->save fails to set the boolean column?
~h