Skip to main content

mz_catalog/durable/upgrade/
v95_to_v96.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, objects_v95 as v95, objects_v96 as v96};
11
12/// Initializes the query-policy ID allocator.
13pub fn upgrade(
14    _snapshot: Vec<v95::StateUpdateKind>,
15) -> Vec<MigrationAction<v95::StateUpdateKind, v96::StateUpdateKind>> {
16    // Absent attachments remain omitted when serialized, so existing records need no rewrites.
17    vec![MigrationAction::Insert(v96::StateUpdateKind::IdAlloc(
18        v96::IdAlloc {
19            key: v96::IdAllocKey {
20                name: "user_query_policy".to_string(),
21            },
22            value: v96::IdAllocValue { next_id: 1 },
23        },
24    ))]
25}