Closed Bug 1358699 Opened 7 years ago Closed 5 years ago

IDBVersionChangeEvent.oldVersion doesn't mention what oldVersion is on first setup

Categories

(Developer Documentation Graveyard :: API: IndexedDB, enhancement, P5)

All
Other
enhancement

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mstange, Assigned: cmills)

References

()

Details

:: Developer Documentation Request

      Request Type: Correction
     Gecko Version: unspecified
 Technical Contact: 

:: Details

The onupgradeneeded handler is also called when the database doesn't exist yet. What's the value of versionChangeEvent.oldVersion in that case? Probably zero, but it needs to be mentioned somewhere.
That does seem to be the case: https://www.w3.org/TR/IndexedDB/#dfn-version

> Each database also has a current version. When a database is first created, its version is 0.
Component: General → API: IndexedDB
I've added a note to cover this just below the summary paragraph (I ran an example to check that it is 0).

I also added a better example, one that actually uses oldVersion ;-)
Assignee: nobody → cmills
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.