ubuntu-calculator-app does no db upgrade to 0.1.1 on first start

Bug #1204702 reported by wiesenth
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu Calculator App
Fix Released
High
Riccardo Padovani

Bug Description

... so that calculations cannot be stored because insertDate does not yet exist.

file:///usr/share/ubuntu-calculator-app/Storage.qml:70: Error: table Calculations has no column named insertDate Unable to execute statement

Without digging into the details the following line in openDB() should fix it (untested):

- if (db.version == "0.1") {
+ if (db.version == "0.1" || db.version == "") {

Related branches

Changed in ubuntu-calculator-app:
status: New → In Progress
assignee: nobody → Riccardo Padovani (rpadovani)
Revision history for this message
David Planella (dpm) wrote :

The Music app guys have got some code to do database schema migrations. It might be worth implementing the same as they're doing for the sake of code reusability.

Changed in ubuntu-calculator-app:
importance: Undecided → High
Revision history for this message
Victor Thompson (vthompson) wrote :

~rpadovani,

I'm a music-app dev and we currently do migrations properly from a clean/first start. Let me know if you want me to try and fix this.

If you still want to fix this, see the following:

http://bazaar.launchpad.net/~music-app-dev/music-app/trunk/view/head:/playlists.js

Revision history for this message
Riccardo Padovani (rpadovani) wrote :

~vthompson,

your implementation is wrong, because you can't have more than one db.changeVersion for session.
This because db.version (that is used by db.changeVersion to check the first argoument) is write in the .ini file associated with the sqllite file, and db.version in changed only by Javascript Garbage Collection, that is called at the closoure of the app.

I write a function (see related branch) that upgrade actual version of db to the last version of db, so we have not change old sql code!

(sorry for bad english, feel free to ask for clarification or ping me, webbyit, on IRC)

Regards,

Revision history for this message
Victor Thompson (vthompson) wrote :

I assure you music-app's implementation is neither wrong, nor does it contain multiple changeVersion callbacks. However, I see you have a merge in the works.

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :

Fix committed into lp:ubuntu-calculator-app at revision 129, scheduled for release in ubuntu-calculator-app, milestone alpha-1

Changed in ubuntu-calculator-app:
status: In Progress → Fix Committed
David Planella (dpm)
Changed in ubuntu-calculator-app:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.