Semver-based migrations

- Put migrations into a separate file: migrations.js
- Add semver, for more specific version-based migrations.
- Change `state.saved.version` to semver app version.
This commit is contained in:
Feross Aboukhadijeh
2016-05-31 13:04:39 -07:00
parent c82bdbd39d
commit 2c0de25423
4 changed files with 92 additions and 56 deletions

View File

@@ -93,7 +93,7 @@ function getDefaultPlayState () {
/* If the saved state file doesn't exist yet, here's what we use instead */
function getDefaultSavedState () {
return {
version: 1, /* make sure we can upgrade gracefully later */
version: config.APP_VERSION, /* make sure we can upgrade gracefully later */
torrents: [
{
status: 'paused',