Comments (2)
You can implement an upgrade and downgrade function per version that changes the data structure.
Whenever you detect a new version with old version storage you apply all the upgrade
functions for each proceeding version after the version stored consecutively:
Could look something like this:
const migrations = [
{
version: 'x.x.x',
upgrade: () => {
// do stuff to upgrade
},
downgrade: () => {
// do stuff to downgrade
}
},
{
version: 'x.x.x',
upgrade: () => {
// do stuff to upgrade
},
downgrade: () => {
// do stuff to downgrade
}
},
{
version: 'x.x.x',
upgrade: () => {
// do stuff to upgrade
},
downgrade: () => {
// do stuff to downgrade
}
},
{
version: 'x.x.x',
upgrade: () => {
// do stuff to upgrade
},
downgrade: () => {
// do stuff to downgrade
}
},
{
version: 'x.x.x',
upgrade: () => {
// do stuff to upgrade
},
downgrade: () => {
// do stuff to downgrade
}
}
]
from nami.
I actually need that feature to be able to push forward a new balance feature, so I will implement the migration system.
@sublayerio proposal fit the requirement, it's basically the same system i'm used to on php side.
Since extension storage isn't really fancy, that should be trivial to implement.
from nami.
Related Issues (20)
- help please HOT 4
- Restoring an overwritten Brave installation and a Nami wallet plugin within that HOT 3
- Can transfer out of wallet-Transaction failed HOT 1
- Assets not showing in imported wallet HOT 1
- Couldn't access my nami wallet and now I can't recover it either HOT 9
- All tx's erroring
- Blank screen in extension HOT 8
- Nami wallet
- Help delegation transaction(delegated on yoroi then looked at nami and have a delegation transaction and my balance is lower) HOT 3
- Sending ETH away from NAMI HOT 6
- :warning: ATTENTION: DO NOT CLICK ANY LINKS IN RESPONSES
- I can
- Unable to withdraw Cardano Nami Wallet staking rewards with Trezor HOT 1
- HW wallets don't need a password HOT 1
- Blank screen in Chrome Extension HOT 2
- Token does not show HOT 3
- transfer completed not showing in nami wallet please advise?? NAMI WALLET cardano ADA HOT 1
- Funds that I transferred have disappeared.. HOT 1
- How to disconnect from dAPP using javascript? HOT 1
- Issue Regarding Ada Handles Resolving To a JPG Store Contract Address HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nami.