From 9041be4dba66bbe77b34224b7a5f56fa39c3c174 Mon Sep 17 00:00:00 2001 From: Bugen Zhao Date: Wed, 30 Oct 2024 17:03:29 +0800 Subject: [PATCH] migrate string len Signed-off-by: Bugen Zhao --- src/meta/model/src/actor.rs | 2 +- src/meta/model/src/actor_dispatcher.rs | 2 +- src/meta/model/src/catalog_version.rs | 2 +- src/meta/model/src/fragment.rs | 2 +- src/meta/model/src/function.rs | 2 +- src/meta/model/src/lib.rs | 4 ++-- src/meta/model/src/object.rs | 2 +- src/meta/model/src/secret.rs | 1 - src/meta/model/src/sink.rs | 2 +- src/meta/model/src/table.rs | 4 ++-- src/meta/model/src/user_privilege.rs | 2 +- src/meta/model/src/worker.rs | 4 ++-- 12 files changed, 14 insertions(+), 15 deletions(-) diff --git a/src/meta/model/src/actor.rs b/src/meta/model/src/actor.rs index cbbbca543679a..e74e6f71dcbfb 100644 --- a/src/meta/model/src/actor.rs +++ b/src/meta/model/src/actor.rs @@ -21,7 +21,7 @@ use crate::{ }; #[derive(Clone, Debug, PartialEq, Eq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] -#[sea_orm(rs_type = "String", db_type = "String(None)")] +#[sea_orm(rs_type = "String", db_type = "String(StringLen::None)")] pub enum ActorStatus { #[sea_orm(string_value = "INACTIVE")] Inactive, diff --git a/src/meta/model/src/actor_dispatcher.rs b/src/meta/model/src/actor_dispatcher.rs index 7d40af6967d35..97c040c06540d 100644 --- a/src/meta/model/src/actor_dispatcher.rs +++ b/src/meta/model/src/actor_dispatcher.rs @@ -23,7 +23,7 @@ use crate::{ActorId, ActorMapping, FragmentId, I32Array}; #[derive( Hash, Copy, Clone, Debug, PartialEq, Eq, EnumIter, DeriveActiveEnum, Serialize, Deserialize, )] -#[sea_orm(rs_type = "String", db_type = "String(None)")] +#[sea_orm(rs_type = "String", db_type = "String(StringLen::None)")] pub enum DispatcherType { #[sea_orm(string_value = "HASH")] Hash, diff --git a/src/meta/model/src/catalog_version.rs b/src/meta/model/src/catalog_version.rs index cfcd90c12f6a0..49a30b1faca8c 100644 --- a/src/meta/model/src/catalog_version.rs +++ b/src/meta/model/src/catalog_version.rs @@ -16,7 +16,7 @@ use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; #[derive(Clone, Copy, Debug, PartialEq, Eq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] -#[sea_orm(rs_type = "String", db_type = "String(None)")] +#[sea_orm(rs_type = "String", db_type = "String(StringLen::None)")] pub enum VersionCategory { #[sea_orm(string_value = "NOTIFICATION")] Notification, diff --git a/src/meta/model/src/fragment.rs b/src/meta/model/src/fragment.rs index 9a365f37377db..c17e26a653913 100644 --- a/src/meta/model/src/fragment.rs +++ b/src/meta/model/src/fragment.rs @@ -33,7 +33,7 @@ pub struct Model { } #[derive(Copy, Clone, Debug, PartialEq, Eq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] -#[sea_orm(rs_type = "String", db_type = "String(None)")] +#[sea_orm(rs_type = "String", db_type = "String(StringLen::None)")] pub enum DistributionType { #[sea_orm(string_value = "SINGLE")] Single, diff --git a/src/meta/model/src/function.rs b/src/meta/model/src/function.rs index 5589c1daa023f..da05ed6b8c4b9 100644 --- a/src/meta/model/src/function.rs +++ b/src/meta/model/src/function.rs @@ -21,7 +21,7 @@ use serde::{Deserialize, Serialize}; use crate::{DataType, DataTypeArray, FunctionId}; #[derive(Clone, Debug, PartialEq, Eq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] -#[sea_orm(rs_type = "String", db_type = "String(None)")] +#[sea_orm(rs_type = "String", db_type = "String(StringLen::None)")] pub enum FunctionKind { #[sea_orm(string_value = "Scalar")] Scalar, diff --git a/src/meta/model/src/lib.rs b/src/meta/model/src/lib.rs index 0b99b48914b2a..4bbf6a287d8d6 100644 --- a/src/meta/model/src/lib.rs +++ b/src/meta/model/src/lib.rs @@ -93,7 +93,7 @@ pub type FragmentId = i32; pub type ActorId = i32; #[derive(Clone, Copy, Debug, PartialEq, Eq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] -#[sea_orm(rs_type = "String", db_type = "String(None)")] +#[sea_orm(rs_type = "String", db_type = "String(StringLen::None)")] pub enum JobStatus { #[sea_orm(string_value = "INITIAL")] Initial, @@ -125,7 +125,7 @@ impl From for PbStreamJobState { } #[derive(Clone, Debug, PartialEq, Eq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] -#[sea_orm(rs_type = "String", db_type = "String(None)")] +#[sea_orm(rs_type = "String", db_type = "String(StringLen::None)")] pub enum CreateType { #[sea_orm(string_value = "BACKGROUND")] Background, diff --git a/src/meta/model/src/object.rs b/src/meta/model/src/object.rs index 4ee0e5a4f4c49..18606e4c6a04e 100644 --- a/src/meta/model/src/object.rs +++ b/src/meta/model/src/object.rs @@ -18,7 +18,7 @@ use serde::{Deserialize, Serialize}; use crate::{DatabaseId, ObjectId, SchemaId, UserId}; #[derive(Clone, Debug, PartialEq, Eq, Copy, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] -#[sea_orm(rs_type = "String", db_type = "String(None)")] +#[sea_orm(rs_type = "String", db_type = "String(StringLen::None)")] pub enum ObjectType { #[sea_orm(string_value = "DATABASE")] Database, diff --git a/src/meta/model/src/secret.rs b/src/meta/model/src/secret.rs index 0d122267bb4bc..bea3f87f56bc9 100644 --- a/src/meta/model/src/secret.rs +++ b/src/meta/model/src/secret.rs @@ -23,7 +23,6 @@ pub struct Model { #[sea_orm(primary_key, auto_increment = false)] pub secret_id: i32, pub name: String, - #[sea_orm(column_type = "Binary(BlobSize::Blob(None))")] pub value: Vec, } diff --git a/src/meta/model/src/sink.rs b/src/meta/model/src/sink.rs index c5a72fbb748c8..d74ea95f4667a 100644 --- a/src/meta/model/src/sink.rs +++ b/src/meta/model/src/sink.rs @@ -23,7 +23,7 @@ use crate::{ }; #[derive(Clone, Debug, PartialEq, Eq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] -#[sea_orm(rs_type = "String", db_type = "String(None)")] +#[sea_orm(rs_type = "String", db_type = "String(StringLen::None)")] pub enum SinkType { #[sea_orm(string_value = "APPEND_ONLY")] AppendOnly, diff --git a/src/meta/model/src/table.rs b/src/meta/model/src/table.rs index 1d950f277396e..7a16b75a52e02 100644 --- a/src/meta/model/src/table.rs +++ b/src/meta/model/src/table.rs @@ -29,7 +29,7 @@ use crate::{ #[derive( Clone, Debug, PartialEq, Hash, Copy, Eq, EnumIter, DeriveActiveEnum, Serialize, Deserialize, )] -#[sea_orm(rs_type = "String", db_type = "String(None)")] +#[sea_orm(rs_type = "String", db_type = "String(StringLen::None)")] pub enum TableType { #[sea_orm(string_value = "TABLE")] Table, @@ -65,7 +65,7 @@ impl From for TableType { } #[derive(Clone, Debug, PartialEq, Eq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] -#[sea_orm(rs_type = "String", db_type = "String(None)")] +#[sea_orm(rs_type = "String", db_type = "String(StringLen::None)")] pub enum HandleConflictBehavior { #[sea_orm(string_value = "OVERWRITE")] Overwrite, diff --git a/src/meta/model/src/user_privilege.rs b/src/meta/model/src/user_privilege.rs index 48f9a38a5504c..e216a1edcfcf3 100644 --- a/src/meta/model/src/user_privilege.rs +++ b/src/meta/model/src/user_privilege.rs @@ -19,7 +19,7 @@ use serde::{Deserialize, Serialize}; use crate::{ObjectId, PrivilegeId, UserId}; #[derive(Clone, Debug, Hash, PartialEq, Eq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] -#[sea_orm(rs_type = "String", db_type = "String(None)")] +#[sea_orm(rs_type = "String", db_type = "String(StringLen::None)")] pub enum Action { #[sea_orm(string_value = "INSERT")] Insert, diff --git a/src/meta/model/src/worker.rs b/src/meta/model/src/worker.rs index ee2ab9b22d3c8..13f9657a8dc7b 100644 --- a/src/meta/model/src/worker.rs +++ b/src/meta/model/src/worker.rs @@ -21,7 +21,7 @@ use serde::{Deserialize, Serialize}; use crate::{TransactionId, WorkerId}; #[derive(Clone, Debug, Hash, PartialEq, Eq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] -#[sea_orm(rs_type = "String", db_type = "String(None)")] +#[sea_orm(rs_type = "String", db_type = "String(StringLen::None)")] pub enum WorkerType { #[sea_orm(string_value = "FRONTEND")] Frontend, @@ -61,7 +61,7 @@ impl From for PbWorkerType { } #[derive(Clone, Debug, PartialEq, Eq, EnumIter, DeriveActiveEnum, Serialize, Deserialize)] -#[sea_orm(rs_type = "String", db_type = "String(None)")] +#[sea_orm(rs_type = "String", db_type = "String(StringLen::None)")] pub enum WorkerStatus { #[sea_orm(string_value = "STARTING")] Starting,