Skip to content
This repository has been archived by the owner on Sep 18, 2020. It is now read-only.

Add migration for new release #186

Merged
merged 8 commits into from
Oct 17, 2019
Merged

Add migration for new release #186

merged 8 commits into from
Oct 17, 2019

Conversation

leventdem
Copy link
Collaborator

No description provided.

    In the old version of masq alpha, the device entry in the profile
    db did not contain the apps info after an activation with maps.
    We therefore add :
    - _checkversion during openProfile
    - _addVersion for addProfile
    - _migration in case we need it
@leventdem leventdem changed the base branch from master to sync-profile October 16, 2019 13:51
src/lib/masq.js Outdated
debug(`The version ${process.env.REACT_APP_VERSION} has been added.`)
}

async _migration (profileId) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, can you move this to a migrations/v0.16.js file ?

const migration = async (masq, profileId) => {
debug('start migration')
const device = await masq.getDevice()
if (!device) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is systematically done in openProfile() I think ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

await this.createNewDevice()

const appDb = masq.appsDBs[appId] ? masq.appsDBs[appId] : openOrCreateDB(appId)
await masq.updateDevice({
...myDevice,
apps: [...myDevice.apps, {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@leventdem leventdem merged commit 31460ea into sync-profile Oct 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants