Skip to content

Commit 7e055cb

Browse files
committed
Better comments and logging in chunk migration
1 parent e2b1836 commit 7e055cb

File tree

1 file changed

+6
-2
lines changed
  • crates/store/re_sorbet/src/migrations

1 file changed

+6
-2
lines changed

crates/store/re_sorbet/src/migrations/mod.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
#![expect(non_snake_case)]
22

33
//! These are the migrations that are introduced for each Sorbet version.
4+
//!
5+
//! When you introduce a breaking change, these are the steps:
6+
//! * Bump [`SorbetSchema::METADATA_VERSION`]
7+
//! * Add a new `mod vX_Y_Z__to__vX_Y_W`
48
59
use std::cmp::Ordering;
610

@@ -109,7 +113,7 @@ pub fn migrate_record_batch(mut batch: RecordBatch) -> RecordBatch {
109113
Ok(batch_version) => match batch_version.cmp(&SorbetSchema::METADATA_VERSION) {
110114
Ordering::Equal => {
111115
// Provide this code path as an early out to avoid unnecessary comparisons.
112-
re_log::trace!("Batch version matches Sorbet version.");
116+
re_log::trace!("Batch version matches Sorbet version ({batch_version})");
113117
batch
114118
}
115119
Ordering::Less => {
@@ -120,7 +124,7 @@ pub fn migrate_record_batch(mut batch: RecordBatch) -> RecordBatch {
120124
);
121125
batch
122126
} else {
123-
re_log::trace!("Performing migrations…");
127+
re_log::debug_once!("Performing migrations from {batch_version}…");
124128
batch = maybe_apply::<v0_0_1__to__v0_0_2::Migration>(&batch_version, batch);
125129
batch = maybe_apply::<v0_0_2__to__v0_1_0::Migration>(&batch_version, batch);
126130
batch = maybe_apply::<v0_1_0__to__v0_1_1::Migration>(&batch_version, batch);

0 commit comments

Comments
 (0)