kellnr_entity/
cratesio_index.rs1use sea_orm::entity::prelude::*;
4
5#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
6#[sea_orm(table_name = "cratesio_index")]
7pub struct Model {
8 #[sea_orm(primary_key)]
9 pub id: i64,
10 #[sea_orm(column_type = "Text")]
11 pub name: String,
12 #[sea_orm(column_type = "Text")]
13 pub vers: String,
14 #[sea_orm(column_type = "JsonBinary", nullable)]
15 pub deps: Option<Json>,
16 #[sea_orm(column_type = "Text")]
17 pub cksum: String,
18 #[sea_orm(column_type = "JsonBinary", nullable)]
19 pub features: Option<Json>,
20 #[sea_orm(column_type = "JsonBinary", nullable)]
21 pub features2: Option<Json>,
22 pub yanked: bool,
23 #[sea_orm(column_type = "Text", nullable)]
24 pub links: Option<String>,
25 pub v: i32,
26 pub crates_io_fk: i64,
27 pub pubtime: Option<DateTime>,
28}
29
30#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
31pub enum Relation {
32 #[sea_orm(
33 belongs_to = "super::cratesio_crate::Entity",
34 from = "Column::CratesIoFk",
35 to = "super::cratesio_crate::Column::Id",
36 on_update = "NoAction",
37 on_delete = "Cascade"
38 )]
39 CratesioCrate,
40}
41
42impl Related<super::cratesio_crate::Entity> for Entity {
43 fn to() -> RelationDef {
44 Relation::CratesioCrate.def()
45 }
46}
47
48impl ActiveModelBehavior for ActiveModel {}