mz_catalog/durable/upgrade/v91_to_v92.rs
1// Copyright Materialize, Inc. and contributors. All rights reserved.
2//
3// Use of this software is governed by the Business Source License
4// included in the LICENSE file.
5//
6// As of the Change Date specified in that file, in accordance with
7// the Business Source License, use of this software will be governed
8// by the Apache License, Version 2.0.
9
10use crate::durable::upgrade::MigrationAction;
11use crate::durable::upgrade::objects_v91 as v91;
12use crate::durable::upgrade::objects_v92 as v92;
13
14/// No-op migration. v91->v92 only adds a `MetricSink` variant to four existing
15/// enums: `CatalogItemType`, `ObjectType`, `CommentObject`, and the audit log's
16/// `ObjectType`. Nothing already stored can be using a variant that didn't
17/// exist, so every v91 record reads back as valid v92.
18///
19/// Metric sinks get no durable record of their own. They are ordinary `Item`s,
20/// and `durable::objects::item_type` works out the type from `create_sql`.
21pub fn upgrade(
22 _snapshot: Vec<v91::StateUpdateKind>,
23) -> Vec<MigrationAction<v91::StateUpdateKind, v92::StateUpdateKind>> {
24 Vec::new()
25}