Skip to content

Commit

Permalink
Add db upgrade logic for the fix introduced with the previous commit.
Browse files Browse the repository at this point in the history
Fixes #711.
  • Loading branch information
ockham committed Jul 30, 2013
1 parent d754ab4 commit 3c12f97
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions gourmet/plugins/nutritional_information/data_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
class NutritionDataPlugin (DatabasePlugin):

name = 'nutritondata'
version = 3
version = 4

def setup_usda_weights_table (self):
self.db.usda_weights_table = Table('usda_weights',self.db.metadata,
Expand Down Expand Up @@ -82,5 +82,7 @@ def update_version (self, gourmet_stored, plugin_stored, gourmet_current, plugin
self.db.alter_table('nutritionaliases',self.setup_nutritionaliases_table,
{},['ingkey','ndbno','density_equivalent'])



if plugin_stored in ['1','2','3']:
# Set the length parameter of the ingkey and unit Strings to 255.
self.db.alter_table('nutritionconversions',self.setup_nutritionconversions_table,
{},['id','factor'])

0 comments on commit 3c12f97

Please sign in to comment.