Skip to content

Commit 224d552

Browse files
authored
Merge pull request #2368 from input-output-hk/dlachaume/2357/verify-min-node-version-with-squash-migration
Feat: verify minimum node version with squash database migration
2 parents c9d0bd9 + 937f2e1 commit 224d552

File tree

13 files changed

+445
-62
lines changed

13 files changed

+445
-62
lines changed

Cargo.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
slug: 9
3+
title: |
4+
9. Database migration squashing
5+
authors:
6+
- name: Mithril Team
7+
tags: [Accepted]
8+
date: 2025-03-13
9+
---
10+
11+
## Status
12+
13+
Accepted
14+
15+
## Context
16+
17+
Over time, many database migrations have accumulated in Mithril nodes. Since these migrations are applied sequentially, the resulting database schema has become difficult to understand and maintain.
18+
19+
## Decision
20+
21+
To address this, the team decided to implement migration squashing once too many migrations have accumulated for a store. This process consolidates all existing migrations into a single, equivalent migration.
22+
23+
## Consequences
24+
25+
- This applies to the migrations of all Mithril node stores
26+
- A squashed migration will be applied when a database is initialized for the first time
27+
- A squashed migration must be optional and should only run if it has not been previously applied with the equivalent migration sequence
28+
- Some nodes may have only partially applied the equivalent sequence of migrations and cannot apply the squashed migration immediately:
29+
- They must first run the migration using the latest distribution that does not include the squashed migration, ensuring their database is prepared to apply it
30+
- This distribution is associated with a squashed migration to provide a smooth user experience.

internal/mithril-persistence/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "mithril-persistence"
3-
version = "0.2.47"
3+
version = "0.2.48"
44
description = "Common types, interfaces, and utilities to persist data for Mithril nodes."
55
authors = { workspace = true }
66
edition = { workspace = true }

0 commit comments

Comments
 (0)