my tweets
- the base class of a class in ruby is...... class. 4 hours ago
- #q107 is playing the b side of abbey road RIGHT NOW (best b-side ever) 5 hours ago
- Agile Tokyo 2010 http://is.gd/dTRp2 7 hours ago
- @xALLIEbabax @clickflickca @Notez that's what were eating! 7 hours ago
- @clickflickca @Notez what you sayin she should be making me dinner ;) LOL #notevenabachelor 7 hours ago
-
RSS Links
Archives
Blogroll
subsonic won’t update my bit field?
I recently ran into a really strange problem while using SubSonic. I had a bit column in my database that was set to not allow nulls and had a default value of false. Pretty standard stuff in the world of database design I guess.
When it came time to start saving my entities to the database, everything was working ok, except…. except after I had created a record in the database I could never change the IsActive column, like wtf? I could never toggle between true and false on an existing record, but an insert would save the record perfectly every time.
To make a long incredibly frustrating story short, it turns out that if you have a bit field, that is set to allow nulls and has a default value of false it will never update (this is only using SubSonic).
So to ensure your bit fields work correctly in SubSonic, make sure those bit columns allow null and don’t have any default values!