use sea_orm::{
ActiveModelBehavior, DeriveEntityModel, DerivePrimaryKey, DeriveRelation, EntityTrait,
EnumIter, PrimaryKeyTrait,
};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel)]
#[sea_orm(table_name = "song_artists")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
#[sea_orm(column_type = "Text")]
pub namespace: String,
#[sea_orm(primary_key, auto_increment = false)]
#[sea_orm(column_type = "Text")]
pub song_value: String,
#[sea_orm(primary_key, auto_increment = false)]
#[sea_orm(column_type = "Integer")]
pub position: i64,
#[sea_orm(column_type = "Text")]
pub artist_id: String,
#[sea_orm(column_type = "Text")]
pub artist_name: String,
}
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {
#[sea_orm(
belongs_to = "super::song_meta::Entity",
from = "(Column::Namespace, Column::SongValue)",
to = "(super::song_meta::Column::Namespace, super::song_meta::Column::SongValue)",
on_update = "NoAction",
on_delete = "Cascade"
)]
Song,
}
impl ActiveModelBehavior for ActiveModel {}