teleclimber / Dropserver

An application platform for your personal web services. https://dropserver.org
Apache License 2.0
42 stars 1 forks source link

Appspace migration fails if migrate-only in the down direction #105

Open teleclimber opened 1 year ago

teleclimber commented 1 year ago

If you try to migrate appspace data in the "migrate only" mode (meaning no app version change, migrate to change the data to match the currently selected app version) then ds-host chooses the wrong version of the code to run migration, and therefore errors when the needed migration function is not found.

Note that on app acquisition ds-host reads teh migration capabilities of the code (what schema versions, up/down) and writes them down in migrations.json in app files metadata.

teleclimber commented 1 year ago

Note that the same error occurs if changing app version and the appspace schema is at a version higher than either to and from app version schemas.

Basically the migration system needs to look at the starting and ending schema versions, and deliberately find one app version that offers the right migrations.