Skip to main content

kellnr_entity/
cratesio_meta.rs

1//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.17
2
3use sea_orm::entity::prelude::*;
4
5#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
6#[sea_orm(table_name = "cratesio_meta")]
7pub struct Model {
8    #[sea_orm(primary_key)]
9    pub id: i64,
10    #[sea_orm(column_type = "Text")]
11    pub version: String,
12    pub downloads: i64,
13    pub crates_io_fk: i64,
14    #[sea_orm(column_type = "Text", nullable)]
15    pub documentation: Option<String>,
16}
17
18#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
19pub enum Relation {
20    #[sea_orm(
21        belongs_to = "super::cratesio_crate::Entity",
22        from = "Column::CratesIoFk",
23        to = "super::cratesio_crate::Column::Id",
24        on_update = "NoAction",
25        on_delete = "Cascade"
26    )]
27    CratesioCrate,
28}
29
30impl Related<super::cratesio_crate::Entity> for Entity {
31    fn to() -> RelationDef {
32        Relation::CratesioCrate.def()
33    }
34}
35
36impl ActiveModelBehavior for ActiveModel {}