risingwave_meta_model/
fragment_relation.rsuse sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
use crate::actor_dispatcher::DispatcherType;
use crate::{FragmentId, I32Array};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[sea_orm(table_name = "fragment_relation")]
pub struct Model {
#[sea_orm(primary_key)]
pub source_fragment_id: FragmentId,
#[sea_orm(primary_key)]
pub target_fragment_id: FragmentId,
pub dispatcher_type: DispatcherType,
pub dist_key_indices: I32Array,
pub output_indices: I32Array,
}
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {
#[sea_orm(
belongs_to = "super::fragment::Entity",
from = "Column::SourceFragmentId",
to = "super::fragment::Column::FragmentId",
on_update = "NoAction",
on_delete = "Cascade"
)]
SourceFragment,
#[sea_orm(
belongs_to = "super::fragment::Entity",
from = "Column::TargetFragmentId",
to = "super::fragment::Column::FragmentId",
on_update = "NoAction",
on_delete = "Cascade"
)]
TargetFragment,
}
impl ActiveModelBehavior for ActiveModel {}