kellnr-entity 6.13.0

Kellnr is a self-hosted registry for Rust crates with support for rustdocs and crates.io caching.
Documentation
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.17

use sea_orm::entity::prelude::*;

#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "crate_dependency")]
pub struct Model {
    #[sea_orm(primary_key)]
    pub id: i64,
    pub crate_index_fk: i64,
    #[sea_orm(column_type = "Text")]
    pub name: String,
    #[sea_orm(column_type = "Text")]
    pub version_req: String,
    #[sea_orm(column_type = "Text")]
    pub kind: String,
}

#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {
    #[sea_orm(
        belongs_to = "super::crate_index::Entity",
        from = "Column::CrateIndexFk",
        to = "super::crate_index::Column::Id",
        on_update = "NoAction",
        on_delete = "Cascade"
    )]
    CrateIndex,
}

impl Related<super::crate_index::Entity> for Entity {
    fn to() -> RelationDef {
        Relation::CrateIndex.def()
    }
}

impl ActiveModelBehavior for ActiveModel {}