Skip to main content

kellnr_entity/
cratesio_crate.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_crate")]
7pub struct Model {
8    #[sea_orm(primary_key)]
9    pub id: i64,
10    #[sea_orm(column_type = "Text", unique)]
11    pub name: String,
12    #[sea_orm(column_type = "Text", unique)]
13    pub original_name: String,
14    pub e_tag: String,
15    #[sea_orm(column_type = "Text")]
16    pub last_modified: String,
17    #[sea_orm(column_type = "Text", nullable)]
18    pub description: Option<String>,
19    pub total_downloads: i64,
20    #[sea_orm(column_type = "Text")]
21    pub max_version: String,
22    #[sea_orm(column_type = "Text")]
23    pub last_updated: String,
24}
25
26#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
27pub enum Relation {
28    #[sea_orm(has_many = "super::cratesio_index::Entity")]
29    CratesioIndex,
30    #[sea_orm(has_many = "super::cratesio_meta::Entity")]
31    CratesioMeta,
32}
33
34impl Related<super::cratesio_index::Entity> for Entity {
35    fn to() -> RelationDef {
36        Relation::CratesioIndex.def()
37    }
38}
39
40impl Related<super::cratesio_meta::Entity> for Entity {
41    fn to() -> RelationDef {
42        Relation::CratesioMeta.def()
43    }
44}
45
46impl ActiveModelBehavior for ActiveModel {}