mysql upgrade?

Asked by Roberto Leibman on 2013-03-25

I have a mysql gourmet database (with lots of recipes!) that was working with version 15.9, it no longer works with version 16.0, probably because of the changes in primary keys. Is there an upgrade sql script?

Question information

Language:
English Edit question
Status:
Solved
For:
Gourmet Edit question
Assignee:
No assignee Edit question
Solved by:
Roberto Leibman
Solved:
2013-03-25
Last query:
2013-03-25
Last reply:

answering myself, but I'm not sure this will work:

It seems like it's only the tables pantry, shopcats and shopcatsorder that are affected, so something like this might make it work:

alter table shopcats drop primary key;
alter table shopcatsadd id integer not null auto_increment primary key;
alter table shopcatsorder drop primary key;
alter table shopcatsorder add id integer not null auto_increment primary key;
alter table pantry drop primary key;
alter table pantry add id integer not null auto_increment primary key;

Bernhard Reiter (ockham-razor) said : #2

Sorry about the inconvenience. Yeah, 0.16.0 adds primary keys to those tables (ironically with the exact objective to make Gourmet work with MySQL). Sorry it didn't work out for you. Gourmet actually does check if it needs to upgrade the existing database -- seems like you already had manually created primary keys that somehow collideded with the ones that Gourmet was trying to add to your DB. One possible workaround might be to use the 0.15.9 database backup, and manually change the version stored (from 0,15,9 to 0,16,0) in the info table to avoid Gourmet's upgrade attempts.

Anyway, did the sequence of commands you were suggesting work out for you?

answering myself, but I'm not sure this will work:

It seems like it's only the tables pantry, shopcats and shopcatsorder that are affected, so something like this might make it work:

alter table shopcats drop primary key;
alter table shopcatsadd id integer not null auto_increment primary key;
alter table shopcatsorder drop primary key;
alter table shopcatsorder add id integer not null auto_increment primary key;
alter table pantry drop primary key;
alter table pantry add id integer not null auto_increment primary key;

Well, I got past those problems, but I seem to be having others pertaining to utf-8 and what not when importing new recipes, I'm not sure what they are yet. I do have a copy of the database in the regular format and will be using that for a bit, but I will export it back to mysql at some point.

It may be a bit stubborn from me, but I want it in mysql so I can access it from a web app (which I'm writing using scala/play framework). I want to be able to access a simple version of the recipes from my phone or tablet in the kitchen, not only from my server or laptop.

I also plan to have the option in my web app to add a recipe to my google calendar for my weekly menu planning.

Bernhard Reiter (ockham-razor) said : #5

Feel free to post any bug reports regarding those other issues you mention to our issues tracker over at GitHub, https://github.com/thinkle/gourmet/issues

Using MySQL with gourmet is perfectly legit, and in fact has been requested a couple of times, which is why I implemented that change to the DB structure in the first place. I hope to find some time to tackle https://github.com/thinkle/gourmet/issues/682 soon.

As for the web app, sounds pretty cool! (Have you noticed the web_plugin folder though, where Tom has started to work on a Django based web app?) Anyway, I'd be curious about any Gourmet-related code you produce!