Shirakumo / radiance

A Common Lisp web application environment
https://shirakumo.github.io/radiance/
zlib License
311 stars 19 forks source link

Version Migration Facility #30

Closed Shinmera closed 5 years ago

Shinmera commented 5 years ago

As Radiance, and modules built on it, evolve, certain breaking changes will from time to time be necessary (#29). In order to accommodate this, and in order not to break existing setups, a migration facility should be introduced.

This facility should keep track of versions of used modules, and automatically trigger a function that can perform migration steps when a version change occurs. This migration should be run as part of Radiance's startup sequence, and should probably be coded something like this:

(defgeneric migrate (module from-version to-version))

Calling this function will need a bit more setup however, in order to not skip versions when the change is between multiple concrete versions. So for instance if there are versions 1.0, 1.1, and 2.0, but the change happens from 1.0 to 2.0, migrate should be called with both 1.0 1.1 and 1.1 2.0.

By letting from-version be NIL if the module has not been installed previously we can also alleviate issues such as new default permissions not being applied for new users.