risingwave_meta_model/
hummock_sequence.rs

1// Copyright 2025 RisingWave Labs
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15use sea_orm::entity::prelude::*;
16use serde::{Deserialize, Serialize};
17pub const COMPACTION_TASK_ID: &str = "compaction_task";
18pub const COMPACTION_GROUP_ID: &str = "compaction_group";
19pub const SSTABLE_OBJECT_ID: &str = "sstable_object";
20pub const META_BACKUP_ID: &str = "meta_backup";
21/// The read & write of now is different from other sequences. It merely reuses the hummock_sequence table.
22pub const HUMMOCK_NOW: &str = "now";
23
24#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Default, Serialize, Deserialize)]
25#[sea_orm(table_name = "hummock_sequence")]
26pub struct Model {
27    #[sea_orm(primary_key, auto_increment = false)]
28    pub name: String,
29    pub seq: i64,
30}
31
32#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
33pub enum Relation {}
34
35impl ActiveModelBehavior for ActiveModel {}