Opened 8 years ago

Closed 8 years ago

#41 closed defect (fixed)

Upgrading database from version 1 fails

Reported by: flip Owned by: flip
Priority: minor Milestone:
Component: other Version:
Keywords: Cc:


Database version 1 was used until Vespa 0.2.0 which was the first release of RFPulse 14 months ago. The code to upgrade the database from v1 to v2 worked for a while, but it is now broken. Specifically, when trying to start any Vespa app, the upgrade fails with this error:

sqlite3.OperationalError: table results has no column named ocn_state_id

One workaround is to delete the database (see this article on how to find the database). Vespa will happily build a new one from scratch.

The problem is in in _upgrade_1(). After adding RFPulse-specific tables, it invokes util_import.PulseProjectImporter to re-create the sample pulse projects. That worked at the time the code was written. However, since then pulse projects have become more complex. Optimal control added a bunch of tables to the pulse project part of the database. util_import.PulseProjectImporter expects those tables to be there, but they're not when the database is in the process of being upgraded from version 1 to 2. Those tables didn't appear in Vespa until database version 7 (Vespa 0.3.1). Once the upgrade process is complete, it will be at version 7 and util_import.PulseProjectImporter would work, but it won't work where it's currently being called.

I'm filing this as a minor bug since anyone who encounters this bug hasn't used Vespa for a looong time and probably is not very attached to what's in their database. As a result, the workaround of deleting the database is no big deal.

Change History (1)

comment:1 Changed 8 years ago by flip

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in r3392. Those upgrading from database v1 won't get the sample pulse projects, so this is not an ideal fix but I doubt it will affect anyone.

Note: See TracTickets for help on using tickets.