Skip to content

Commit

Permalink
fix: fix column nullable definition for index column properties (#18334)
Browse files Browse the repository at this point in the history
  • Loading branch information
yezizp2012 authored Aug 30, 2024
1 parent 59b400a commit 29db1d9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/meta/model_v2/src/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub struct Model {
pub index_table_id: TableId,
pub primary_table_id: TableId,
pub index_items: ExprNodeArray,
pub index_column_properties: IndexColumnPropertiesArray,
pub index_column_properties: Option<IndexColumnPropertiesArray>,
pub index_columns_len: i32,
}

Expand Down Expand Up @@ -77,7 +77,7 @@ impl From<PbIndex> for ActiveModel {
primary_table_id: Set(pb_index.primary_table_id as _),
index_items: Set(pb_index.index_item.into()),
index_columns_len: Set(pb_index.index_columns_len as _),
index_column_properties: Set(pb_index.index_column_properties.into()),
index_column_properties: Set(Some(pb_index.index_column_properties.into())),
}
}
}
6 changes: 5 additions & 1 deletion src/meta/src/controller/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,11 @@ impl From<ObjectModel<index::Model>> for PbIndex {
index_table_id: value.0.index_table_id as _,
primary_table_id: value.0.primary_table_id as _,
index_item: value.0.index_items.to_protobuf(),
index_column_properties: value.0.index_column_properties.to_protobuf(),
index_column_properties: value
.0
.index_column_properties
.map(|p| p.to_protobuf())
.unwrap_or_default(),
index_columns_len: value.0.index_columns_len as _,
initialized_at_epoch: Some(
Epoch::from_unix_millis(value.1.initialized_at.and_utc().timestamp_millis() as _).0,
Expand Down

0 comments on commit 29db1d9

Please sign in to comment.