kyle.fazzari at canonical.com
Wed Nov 2 15:09:22 UTC 2016
On 11/02/2016 12:41 AM, Didier Roche wrote:
> Le 28/10/2016 à 21:00, Aaron Ogle a écrit :
>> Point definitely well made. I'm with you now. :)
>> Now this being the case. I can't just swap the location. This is
>> where I would need a rock solid upgrade hook. But I would only need
>> to run it the once. Any suggestions? Or any good examples?
> Maybe Kyle missed that one.
> For now, AFAIK, we don't have upgrade hook (yet ;)). I would go with the
> wrapper script (that I think you already have) path. Check for the
> database location in $SNAP_DATA. If nothing exists, do the migration,
> remove $SNAP_COMMON database content once done.
Ah, sorry guys.
You can likely use the `configure` hook for this, too (I believe it runs
upon upgrade). The problem you'll run into with both approaches is that
you'll have to maintain this migration code forever since you never know
the version of the snap from which a user will be upgrading. This
problem will be solved with stepped upgrades and epoch support, but
we're not there yet.
Kyle Fazzari (kyrofa)
kyle at canonical.com
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 819 bytes
Desc: OpenPGP digital signature
More information about the Snapcraft