This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 14318 - Importance of the upgradeneeded event should be more explicit
Summary: Importance of the upgradeneeded event should be more explicit
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: Indexed Database API (show other bugs)
Version: unspecified
Hardware: All All
: P1 normal
Target Milestone: ---
Assignee: This bug has no owner yet - up for the taking
QA Contact: public-webapps-bugzilla
Depends on:
Reported: 2011-09-27 22:11 UTC by Kyle Huey
Modified: 2011-12-27 22:00 UTC (History)
4 users (show)

See Also:


Description Kyle Huey 2011-09-27 22:11:54 UTC
It is never explicitly stated that the upgradeneeded event is your one chance to modify the database schema.  This only becomes apparent after reading the VERSION_CHANGE transaction steps in detail.  It's easy to miss this subtle point (at least it was for me :-P).
Comment 1 Jonas Sicking (Not reading bugmail) 2011-09-28 00:36:54 UTC
Did it seem like there was any other way to get a VERSION_CHANGE transaction? If so, where? There would likely be the place to indicate that it does not, in fact, produce a VERSION_CHANGE transaction.
Comment 2 Eliot Graff 2011-12-27 22:00:39 UTC
Added the following note to the Editor's Draft of 12/27:

A VERSION_CHANGE transaction is automatically created when, during the open database API, a database version number is provided that is greater than the current database version.  This transaction will be active inside the onupgradeneeded event handler, allowing the creation of new object stores and indexes.