Daniel Gasienica
7413b787b6
Make `migrations` private
7 years ago
Daniel Gasienica
805031ade8
Conditionally run post-attachment migrations
...
Introduce placeholder migrations for Backbone models so they never implicitly
run migrations whenever they are `fetch`ed. We prefer to run our migrations
explicitly upon app startup and then let Backbone models be (slightly) dumb(er)
models, without inadvertently triggering migrations.
7 years ago
Daniel Gasienica
bfbeedab5c
Temporarily disable post-attachment migration migrations
7 years ago
Daniel Gasienica
d9be6a0f94
Destructure Lodash `require`s
7 years ago
Daniel Gasienica
1f8556b049
Remove unused `createCollection`
7 years ago
Daniel Gasienica
eca930770c
Remove hard-coded database connection settings
7 years ago
Daniel Gasienica
457bf7ab9d
Add `createCollection` function
7 years ago
Daniel Gasienica
da144edc56
Manually close database connection after migration
7 years ago
Daniel Gasienica
106ce21c49
Remove redundant log message
7 years ago
Daniel Gasienica
fcd30cd919
Close database after migration
...
This is not 100% reliable as database connections are closed in a separate
thread according to the documentation:
- https://developer.mozilla.org/en-US/docs/Web/API/IDBDatabase/close
- https://stackoverflow.com/a/18639298
- 80c7a06d5c/backbone-indexeddb.js (L558-L565)
7 years ago
Daniel Gasienica
d7c8d33edb
Extract `runMigrations`
7 years ago
Daniel Gasienica
d16178638e
Split database migrations into pre- and post-attachment migration
...
- Run light-weight migrations before attachment migration.
- Run regular migrations after attachments have been moved to disk.
7 years ago