diff options
author | frankiebee <frankie.diamond@gmail.com> | 2018-04-06 07:22:24 +0800 |
---|---|---|
committer | frankiebee <frankie.diamond@gmail.com> | 2018-04-06 07:25:13 +0800 |
commit | b9243cd8b9aab3f7eae07fb29f0f184e9a263ee3 (patch) | |
tree | b512cd650c05e5f3f7886c7e6d53bc8e11e6abba /app/scripts/migrations | |
parent | 79932b7e17dd12803e3674ed0780f0edad134a8a (diff) | |
download | tangerine-wallet-browser-b9243cd8b9aab3f7eae07fb29f0f184e9a263ee3.tar tangerine-wallet-browser-b9243cd8b9aab3f7eae07fb29f0f184e9a263ee3.tar.gz tangerine-wallet-browser-b9243cd8b9aab3f7eae07fb29f0f184e9a263ee3.tar.bz2 tangerine-wallet-browser-b9243cd8b9aab3f7eae07fb29f0f184e9a263ee3.tar.lz tangerine-wallet-browser-b9243cd8b9aab3f7eae07fb29f0f184e9a263ee3.tar.xz tangerine-wallet-browser-b9243cd8b9aab3f7eae07fb29f0f184e9a263ee3.tar.zst tangerine-wallet-browser-b9243cd8b9aab3f7eae07fb29f0f184e9a263ee3.zip |
meta - create a migration template
Diffstat (limited to 'app/scripts/migrations')
-rw-r--r-- | app/scripts/migrations/template.js | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/app/scripts/migrations/template.js b/app/scripts/migrations/template.js new file mode 100644 index 000000000..0915c6bdf --- /dev/null +++ b/app/scripts/migrations/template.js @@ -0,0 +1,29 @@ +// next version number +const version = 0 + +/* + +description of migration and what it does + +*/ + +const clone = require('clone') + +module.exports = { + version, + + migrate: async function (originalVersionedData) { + const versionedData = clone(originalVersionedData) + versionedData.meta.version = version + const state = versionedData.data + const newState = transformState(state) + versionedData.data = newState + return versionedData + }, +} + +function transformState (state) { + const newState = state + // transform state here + return newState +} |