db.js icon indicating copy to clipboard operation
db.js copied to clipboard

Update/database migration

Open OleLaursen opened this issue 10 years ago • 1 comments

I appreciate the automatic table creation thing in db.js, but it's lacking a callback for the things it cannot possibly handle because they are application specific. A simple

if (options.migrate) // or perhaps options.update/options.upgrade
    options.migrate(e);

in the onupgradeneeded callback would be nice. It's a shame to see database versioning actually being built into the spec and then not being able to act on it.

OleLaursen avatar Aug 19 '14 13:08 OleLaursen

FYI, I've proposed some alternative structures for schema versioning (based on your schema approach and also on other JSON standards) to treojs/idb-schema/issues/9 . If he has interest to incorporate (of if I am moved to do this in its own repo) and if you are open to it, @aaronpowell, then I could submit a PR here incorporating the independent repo.

Note that I already have an idb-schema branch mostly ready (compared to my latest previous PR or compared to your master), though it is pending changes suggested here and on the proposed changes mentioned above.

brettz9 avatar Apr 03 '16 01:04 brettz9