On Thu, Nov 18, 2010 at 10:58 PM, mdipierro <mdipie...@cs.depaul.edu> wrote:
>
>> I find the migrations to not work that well and fail silently.
>
> there is one catch with migrations. If you use sqlite, you cannot
> change the type of field because sqlite will accept but will not
> actually change the column type. It is because sqlite has limited
> ALTER TABLE support.

The 'correct' way to do this would be to copy the table to a temp
table, drop the original table, define a new one, and then copy data
back. Needless to say, this is far from fool-proof solution. I've been
burned once with migration hell that SQLite creates.

Namely, if you try to preserve the PK column (i.e., copy the PK column
to temp table and restore it later), it tends to stop autoincrementing
the PK column once you start adding new records into the new table
(I'm still not very clear on how exactly this works).


-- 
Branko Vukelić

bg.bra...@gmail.com
stu...@brankovukelic.com

Check out my blog: http://www.brankovukelic.com/
Check out my portfolio: http://www.flickr.com/photos/foxbunny/
Registered Linux user #438078 (http://counter.li.org/)
I hang out on identi.ca: http://identi.ca/foxbunny

Gimp Brushmakers Guild
http://bit.ly/gbg-group

Reply via email to