Have you checked your table afterwords to ensure you don't have any nulls in 
IsReplaced?



select count(IsReplaced) from mytable where IsReplaced is null;



I tested and the alter table does fill with default values for me.  At least 
from the sqlite shell.

Does this work for you?  Are you doing the alter table via your program or via 
the shell?



3.7.9

sqlite> create table t(a integer);
sqlite> insert into t values(1);
sqlite> insert into t values(2);
sqlite> alter table t add column b boolean not null default 0;
sqlite> select * from t;
1|0
2|0





Michael D. Black

Senior Scientist

Advanced Analytics Directorate

Advanced GEOINT Solutions Operating Unit

Northrop Grumman Information Systems

________________________________
From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on 
behalf of Steffen Mangold [steffen.mang...@balticsd.de]
Sent: Wednesday, April 18, 2012 7:46 AM
To: General Discussion of SQLite Database
Subject: EXT :Re: [sqlite] "DEFAULT BOOLEAN NOT NULL" not working with 
entityframework

>
> Hi guys,
>
> i have a little problem with BOOLEAN data column.
>
> I have an existing table filled with data and want to add a new column like 
> "IsReplaced  BOOLEAN NOT NULL DEFAULT 0"
> All worked fine but if I now try to read a data row I gat an exception from 
> the sqlite ado provider that he can not map NULL to Boolean.
> Why is the default value is not working correct with Boolean column? (and yes 
> I know that BOOLEAN in Sqlite is saved as integer, for that I use "DEFAUL 0")
>

Sorry mail was not finished.
I forgot:


Thanks for your help.

Regards Steffen :)
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to