Add a JSON default to fieldPrice so ThingyRecord won't die decoding empty JSON strings

This commit is contained in:
Colin Kuskie 2009-07-22 16:41:26 +00:00
parent b7bde582a6
commit b231bbd89d
2 changed files with 11 additions and 0 deletions

View file

@ -31,6 +31,7 @@ my $quiet; # this line required
my $session = start(); # this line required
replaceUsageOfOldTemplatesAgain($session);
updatePayPalDriversAgain($session);
addThingyRecordFieldPriceDefaults($session);
# upgrade functions go here
@ -92,6 +93,15 @@ sub replaceUsageOfOldTemplatesAgain {
print "DONE!\n" unless $quiet;
}
#----------------------------------------------------------------------------
sub addThingyRecordFieldPriceDefaults {
my $session = shift;
print "\tAdd default fieldPrice JSON to ThingyRecord... " unless $quiet;
# and here's our code
$session->db->write(q|UPDATE ThingyRecord set fieldPrice='{}' where fieldPrice IS NULL|);
print "DONE!\n" unless $quiet;
}
# -------------- DO NOT EDIT BELOW THIS LINE --------------------------------
#----------------------------------------------------------------------------