//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.4 use sea_orm::entity::prelude::*; use serde::{Deserialize, Serialize}; #[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)] #[sea_orm(table_name = "artist")] pub struct Model { #[sea_orm(primary_key)] pub id: i64, pub name: String, pub cover_art_id: Option, pub artist_image_url: Option, pub album_count: i32, pub starred: Option, } #[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] pub enum Relation { #[sea_orm(has_many = "super::album::Entity")] Album, #[sea_orm( belongs_to = "super::cover_art::Entity", from = "Column::CoverArtId", to = "super::cover_art::Column::Id", on_update = "NoAction", on_delete = "SetNull" )] CoverArt, #[sea_orm(has_many = "super::track::Entity")] Track, } impl Related for Entity { fn to() -> RelationDef { Relation::Album.def() } } impl Related for Entity { fn to() -> RelationDef { Relation::CoverArt.def() } } impl Related for Entity { fn to() -> RelationDef { Relation::Track.def() } } impl ActiveModelBehavior for ActiveModel {}