Skip to content

Commit 2c0fbc4

Browse files
tbongers-catklees
authored andcommitted
Setup: Change documentation for objectives and migrations
1 parent 9764092 commit 2c0fbc4

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

components/ILIAS/Setup/README.md

+14-1
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,20 @@ not have any preconditions. These can be achieved, which prepares the environmen
9595
for other objectives to be achievable, until all objectives are achieved and the
9696
setup is completed.
9797

98+
[`DBUpdateSteps`](components/ILIAS/Database/interfaces/Setup/interface.ilDatabaseUpdateSteps.php)
99+
are a special type of `Objective`. Their purpose is to change the database **structure**
100+
to a desired state, i.e. adding fields or changing field types. To change database
101+
**contents**, you can use `Migrations`.
102+
98103

99104
### On Migration
100105

101106
Sometimes an update of an installation requires more work than simply downloading
102107
fresh code and updating the database schema. When, e.g., the certificates where
103108
moved to a new persistant storage model, a lot of data needed to be shuffled around.
104109
This operation would potentially take a lot of time and thus was offloaded to be
105-
triggered by single users.
110+
triggered by single users. A `Migration` is the right tool for this case, as its
111+
purpose is to change the database **contents** to a desired state.
106112

107113
The setup offers functionality for components to encapsulate these kind of operations
108114
to allow administrators to monitor and also run them in a principled way. `Agent`s
@@ -115,6 +121,13 @@ These steps can then be triggered via the CLI and also be monitored there. It is
115121
possible, that there are also other means to trigger the steps, such as an interaction
116122
by the user. The first user of the migrations is the [`FileObject`](components/ILIAS/File/classes/Setup/class.ilFileObjectToStorageMigration.php).
117123

124+
Please keep in mind that a `Migration` should only have to be executed **once** to
125+
change existing data, which means that in parallel the code should be adapted so
126+
that any new content is already stored in the "new" state. Besides that, the code
127+
should also be able to handle date in the "old" state, as the `Migration` might
128+
still be running while the system is already active. These code parts can then
129+
safely be removed alongside the `Migration` itself with the next major version.
130+
118131

119132
### On Artifact
120133

0 commit comments

Comments
 (0)