Migrations
A mapping from version numbers to session migration functions. Each entry in this object has a version number as a key, and a function as a value.
For a key n
, the respective value should be a function that takes the previous session data and migrates it to conform with the data that is used by version n
. The previous session data is defined by the next key less than n
, such as n
. Versions don’t have to be integers, nor do all versions have to be adjacent. For example, you can use [1
as versions. If n
is the lowest value in the set of keys, the function stored for n
can be used to migrate session data that was stored before migrations were used.