kellnr_entity/
crate_dependency.rs1use sea_orm::entity::prelude::*;
4
5#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
6#[sea_orm(table_name = "crate_dependency")]
7pub struct Model {
8 #[sea_orm(primary_key)]
9 pub id: i64,
10 pub crate_index_fk: i64,
11 #[sea_orm(column_type = "Text")]
12 pub name: String,
13 #[sea_orm(column_type = "Text")]
14 pub version_req: String,
15 #[sea_orm(column_type = "Text")]
16 pub kind: String,
17}
18
19#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
20pub enum Relation {
21 #[sea_orm(
22 belongs_to = "super::crate_index::Entity",
23 from = "Column::CrateIndexFk",
24 to = "super::crate_index::Column::Id",
25 on_update = "NoAction",
26 on_delete = "Cascade"
27 )]
28 CrateIndex,
29}
30
31impl Related<super::crate_index::Entity> for Entity {
32 fn to() -> RelationDef {
33 Relation::CrateIndex.def()
34 }
35}
36
37impl ActiveModelBehavior for ActiveModel {}