Skip to main content

kellnr_entity/
toolchain.rs

1//! `SeaORM` Entity for toolchain releases
2
3use sea_orm::entity::prelude::*;
4
5#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
6#[sea_orm(table_name = "toolchain")]
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 version: String,
14    #[sea_orm(column_type = "Text")]
15    pub date: String,
16    #[sea_orm(column_type = "Text", nullable)]
17    pub channel: Option<String>,
18    #[sea_orm(column_type = "Text")]
19    pub created: String,
20}
21
22#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
23pub enum Relation {
24    #[sea_orm(has_many = "super::toolchain_target::Entity")]
25    ToolchainTargets,
26}
27
28impl Related<super::toolchain_target::Entity> for Entity {
29    fn to() -> RelationDef {
30        Relation::ToolchainTargets.def()
31    }
32}
33
34impl ActiveModelBehavior for ActiveModel {}