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    #[sea_orm(column_type = "Text", nullable)]
17    pub license: Option<String>,
18}
19
20#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
21pub enum Relation {
22    #[sea_orm(
23        belongs_to = "super::cratesio_crate::Entity",
24        from = "Column::CratesIoFk",
25        to = "super::cratesio_crate::Column::Id",
26        on_update = "NoAction",
27        on_delete = "Cascade"
28    )]
29    CratesioCrate,
30}
31
32impl Related<super::cratesio_crate::Entity> for Entity {
33    fn to() -> RelationDef {
34        Relation::CratesioCrate.def()
35    }
36}
37
38impl ActiveModelBehavior for ActiveModel {}