On Fri, Jun 1, 2012 at 5:42 PM, Bill Moseley <mose...@hank.org> wrote: > > > On Fri, Jun 1, 2012 at 3:09 PM, fREW Schmidt <fri...@gmail.com> wrote: >> >> >> Why not just add a database level default? That would be easy, clean, and >> correct. Plus if do that to remove the actual nulls from the DB > > > That only applies to new rows inserted. These are old and existing > databases and trying to solve this outside of the database.
This sounds like a really bad solution. Technically, it could work. But, this is a prime example of "Action at a Distance" and a violation of the "Single Responsibility Principle". You're taking an existing row, loading it into a business application, using it in a completely unrelated way, and then defaulting the timezone if the row changes in any way. I hope you realize how disruptive this can be. The right solution is to fix the errant rows in the database separately from the business application in a one-time script. That fixes the existing rows. Then, apply a default at the database level to make sure new rows from any source are setup properly. -- Thanks, Rob Kinyon _______________________________________________ List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class IRC: irc.perl.org#dbix-class SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/ Searchable Archive: http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk