If the database does exist but you are specifying an upgraded version number, an onupgradeneeded event is triggered straight away, allowing you to provide an updated schema in its handler. More on this later in Updating the version of the database below, and the IDBFactory.open reference ...