aerogear / offix

GraphQL Offline Client and Server
https://offix.dev
Apache License 2.0
758 stars 45 forks source link

Automatically upgrading local databse to support new version of Datasync #686

Closed Eunovo closed 4 years ago

Eunovo commented 4 years ago

Feature Request

Is your feature request related to a problem? Please describe. Apart from user models, Offix-Datasync create other stores for metadata and other non-api related features. We currently allow users to initiate a schema upgrade by incrementing a schema version param when their schema have changed but what about store changes due to changes in Datasync's internal workings? How do we update the local DB without using the user's schema version? We have already experienced this problem ourselves during development of Offix-Datasync as the sample app fails every time we upgrade Offix-Datasync.

Possible Solutions I have considered

None of the approaches seems to be particularly simple but the second one could be more difficult. cc @wtrocki @kingsleyzissou

wtrocki commented 4 years ago

Another solution is to manage the schema version ourselves.

I do not have answer for this, but I have started adding this for metadata store.

wtrocki commented 4 years ago

See also https://github.com/aerogear/offix/issues/733

wtrocki commented 4 years ago

Automatic update requires us to track the new fields in the CLI. which is possible however if field is required we not going to provide default values. CLosing this one in fav of https://github.com/aerogear/offix/issues/817