use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
#[sea_orm(table_name = "areas")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: Uuid,
/// Unique only within one person's list of areas, not globally.
pub name: String,
pub lat: f64,
pub lon: f64,
pub zoom: i32,
pub created_by: Option<Uuid>,
pub created_at: DateTimeWithTimeZone,
}
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {
#[sea_orm(has_many = "super::restaurants::Entity")]
Restaurants,
}
impl Related<super::restaurants::Entity> for Entity {
fn to() -> RelationDef {
Relation::Restaurants.def()
}
}
impl ActiveModelBehavior for ActiveModel {}
neiam
/fieri-forever
the flavortown lunch engine
public · Issues · Pulls · Labels · Forks · Compare · Actions success · Badges · Packages
⭐
Log in to mark this repository.
820 B · text
History
aecd85b