Skip to content
This repository was archived by the owner on Oct 16, 2026. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions crates/crab_config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,21 @@ Version field name is defined in: `configurable.rs` under the name of const vari
### Core concepts
- **Node** - A node is a single value in the config tree. It can be a primitive type, a list, or a map.
- **Migration** - A migration is a function that takes a config and returns a new config. It is used to update the config to a new version.

### Migration Version

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
### Migration Version
### CrabCraft Migration Version
Suggested change
### Migration Version
### Migration Version (CrabCraft)


> This documentation applies only for the CrabCraft project. For other projects, you can use any versioning scheme you like.

CrabCraft uses a strict versioning scheme for configuration migrations to ensure compatibility and safe upgrades. The format is:

```txt
MAJOR.MINOR.PATCH-migration.<MIGRATION>
```

* **MAJOR.MINOR.PATCH** – Matches the version of the CrabCraft binary.
* **MIGRATION** – A sequential index representing a specific migration step for this binary version. Each migration transforms the config from one version to the next, allowing the system to safely apply incremental updates.
Comment thread
Sanielia marked this conversation as resolved.

Each migration should be placed in a separate file inside the `src/config/migrations/` directory. File names must follow this pattern:
```txt
m_<MAJOR>_<MINOR>_<PATCH>_<MIGRATION>_<VERY SHORT DESCRIPTION>.rs

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
m_<MAJOR>_<MINOR>_<PATCH>_<MIGRATION>_<VERY SHORT DESCRIPTION>.rs
m_<MAJOR>_<MINOR>_<PATCH>_<MIGRATION>_<VERY_SHORT_DESCRIPTION>.rs

```