upgradeneeded event
The IndexedDB event fired when a page opens a database with a higher version number than the stored one, the only place the schema can change.
In more detail
indexedDB.open('app', 3) on a database at version 2 fires upgradeneeded with oldVersion 2 and newVersion 3, inside a special versionchange transaction. Create or change object stores and indexes there.
Related terms
- IndexedDB — The browser's built-in asynchronous, transactional database for storing large amounts of structured data, including files and binary data.
- schema — A formal description of the structure of data: which fields or columns exist, their types and which are required.
- database migration — A scripted, versioned change to a database's structure, such as adding a table or a constraint.
- object store — The IndexedDB equivalent of a table: a named collection of records, each found by its key.
Taught in
- IndexedDB In Practice: Object Stores, Indexes And Transactions — Frontend Architecture & Web Platform