One of the main design goals of CubicWeb was to support iterative and agile development. For this purpose, multiple actions are provided to facilitate the improvement of an instance, and in particular to handle the changes to be applied to the data model, without loosing existing data.
The current version of a cube (and of cubicweb itself) is provided in the file __pkginfo__.py as a tuple of 3 integers.
Migration scripts has to be located in the directory migration of your cube and named accordingly:
<version n° X.Y.Z>[_<description>]_<mode>.py
in which :
Again in the directory migration, the file depends.map allows to indicate that for the migration to a particular model version, you always have to first migrate to a particular CubicWeb version. This file can contain comments (lines starting by #) and a dependancy is listed as follows:
<model version n° X.Y.Z> : <cubicweb version n° X.Y.Z>
For example:
0.12.0: 2.26.0
0.13.0: 2.27.0
# 0.14 works with 2.27 <= cubicweb <= 2.28 at least
0.15.0: 2.28.0
The following identifiers are pre-defined in migration scripts:
In the repository scripts, the following identifiers are also defined:
The following functions for schema migration are available in repository scripts:
The following functions for data migration are available in repository scripts:
The following functions for workflow creation are available in repository scripts:
You can find more details about workflows in the chapter Workflow .
The following functions for configuration migration are available in all scripts:
Those functions are only used for low level operations that could not be accomplished otherwise or to repair damaged databases during interactive session. They are available in repository scripts:
[FIXME] Add explanation on how to use cubicweb-ctl shell