Skip to content

[FEATURE] Setup: add database update steps guideline.#11616

Open
thibsy wants to merge 1 commit into
ILIAS-eLearning:trunkfrom
srsolutionsag:feature/12/setup-db-update-steps
Open

[FEATURE] Setup: add database update steps guideline.#11616
thibsy wants to merge 1 commit into
ILIAS-eLearning:trunkfrom
srsolutionsag:feature/12/setup-db-update-steps

Conversation

@thibsy

@thibsy thibsy commented May 29, 2026

Copy link
Copy Markdown
Contributor

Hi folks,

Here's my proposal for the database update steps guideline.

Please let me know what you think about my recommendations, how strictly we want to phrase adherence (currently "SHOULD") and if there are something else missing or wrong in terms of content.

@fwolf-ilias I have added you to verify my sentences about the ILIAS upgrade and release process in general.

@ILIAS-eLearning/technical-board I have added your label, since this PR was created thanks to your funding.

Kind regards,
@thibsy

@thibsy thibsy added technical board documentation Pull requests that only update or add documentation. labels May 29, 2026
@thibsy thibsy force-pushed the feature/12/setup-db-update-steps branch from afb1fea to be4d849 Compare May 29, 2026 13:27
@fwolf-ilias

Copy link
Copy Markdown
Contributor

No objections regarding the state of the database in connection with the release update/upgrade.

@chfsx chfsx left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks a lot!

@mjansenDatabay mjansenDatabay left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @thibsy ,

Thank you a lot for this pull request. This guideline addresses a real gap in our documentation.

Please answer the following questions:


  • Should this document replace, supersede, or complement "docs/development/database-updates.md"? The existing doc still recommends il$COMPONENT…Steps naming and classes/Setup placement, while this guideline proposes ILIAS\<Component>\Setup\Database\V<n>\.... Without an explicit relationship, developers/authorities will not know which convention applies.
  • For the n+2 removal rule: can you add a concrete worked example? The rule is understandable (for me) in principle, but the n / n+1 / n+2 notation is easy to misread without one.
  • How should backports be handled in practice? Chapter 2 explains the branching problem well, but the operational workflow is missing (e.g. same fix in "trunk" and "release_n" → separate "V11" / "V12" classes? hotfix steps like ilHelpDB10HotfixSteps?).

Please consider the following suggestions. You do not need to follow those, but please indicate shortly why you prefer to do otherwise:


  • Cross-link to "docs/development/database-updates.md" for operational basics (prepare(), wiring the Agent, getStatusObjective() with ilDatabaseUpdateStepsMetricsCollectedObjective, using only ilDBInterface, grouping via ObjectiveCollection). This guideline focuses on lifecycle and branching, the other document covers day-to-day implementation.
  • Add a minimal example for ObjectiveWithPreconditions when one step class depends on another and/or decide, whether to put this bonus tip to "docs/development/database-updates.md".
  • Update code examples to match the real interface or point to "docs/development/database-updates.md": every ilDatabaseUpdateSteps implementation must implement prepare(\ilDBInterface $db): void; . The Agent examples should include getStatusObjective() where applicable.
  • Add an explicit warning that renaming or moving an ilDatabaseUpdateSteps class changes its FQDN and causes the setup to treat all steps as new, with potentially dangerous re-execution on existing installations when there is no "guard" code in place.
  • Clarify the relationship to the legacy naming still prevalent in the codebase and whether version namespaces are the target state for new code only.
    

Best regards,
Michael

on behalf of the Technical Board

- the step number (gathered from your `step_<nr>()` methods)
- the FQDN of your implementation (class that implements `\ilDatabaseUpdateSteps`)

**It is therecore important that the FQDN of an implementation MUST NOT change.** Otherwise update steps are considered

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
**It is therecore important that the FQDN of an implementation MUST NOT change.** Otherwise update steps are considered
**It is therefore important that the FQDN of an implementation MUST NOT change.** Otherwise update steps are considered

sign off on code changes](../../../../docs/development/maintenance.md#authorities) and guides all ILIAS developers who
perform database updates.

This guide will refer to database updates as schmea updates (DDL), but it possibly applies to other operations (DML,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This guide will refer to database updates as schmea updates (DDL), but it possibly applies to other operations (DML,
This guide will refer to database updates as schema updates (DDL), but it possibly applies to other operations (DML,


### 2.2. Recommended Namespace Pattern

To implement this consistently accross all ILIAS components and prevent possibly divergent database update steps,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
To implement this consistently accross all ILIAS components and prevent possibly divergent database update steps,
To implement this consistently across all ILIAS components and prevent possibly divergent database update steps,

```php
namespace ILIAS\ComponentX\Setup;

class AgenfOfX implements \ILIAS\Setup\Agent

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
class AgenfOfX implements \ILIAS\Setup\Agent
class AgentOfX implements \ILIAS\Setup\Agent

```php
namespace ILIAS\ComponentX\Setup;

class AgenfOfX implements \ILIAS\Setup\Agent

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
class AgenfOfX implements \ILIAS\Setup\Agent
class AgentOfX implements \ILIAS\Setup\Agent

e.g. `ILIAS\ComponentX\Setup\Database\V10\UpdateSteps::step_2()` is completely independent from
`ILIAS\ComponentX\Setup\Database\V11\UpdateSteps::step_2()`.

### 2.2. Recommended Namespace Pattern

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has to be 2.1, not 2.2.


Bonus tip: use an `ILIAS\Setup\ObjectiveWithPreconditions` to control the order of your `\ilDatabaseUpdateSteps`.

### 3.2. Removing Database Update Steps

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And again "3.2" ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Pull requests that only update or add documentation. technical board

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants