kellnr_entity/
cratesio_index.rs

1//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.16
2
3use 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}
28
29#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
30pub enum Relation {
31    #[sea_orm(
32        belongs_to = "super::cratesio_crate::Entity",
33        from = "Column::CratesIoFk",
34        to = "super::cratesio_crate::Column::Id",
35        on_update = "NoAction",
36        on_delete = "Cascade"
37    )]
38    CratesioCrate,
39}
40
41impl Related<super::cratesio_crate::Entity> for Entity {
42    fn to() -> RelationDef {
43        Relation::CratesioCrate.def()
44    }
45}
46
47impl ActiveModelBehavior for ActiveModel {}