//! SeaORM Entity. Generated by sea-orm-codegen 0.4.2 use sea_orm::entity::prelude::*; #[derive(Clone, Debug, PartialEq, DeriveEntityModel)] #[sea_orm(table_name = "address")] pub struct Model { #[sea_orm(primary_key, auto_increment = false)] pub address_id: i32, pub address: String, pub address2: Option, pub district: String, pub city_id: i32, pub postal_code: Option, pub phone: String, pub last_update: DateTime, } #[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] pub enum Relation { #[sea_orm( belongs_to = "super::city::Entity", from = "Column::CityId", to = "super::city::Column::CityId", on_update = "Cascade", on_delete = "NoAction" )] City, #[sea_orm(has_many = "super::customer::Entity")] Customer, #[sea_orm(has_many = "super::staff::Entity")] Staff, #[sea_orm(has_many = "super::store::Entity")] Store, } impl Related for Entity { fn to() -> RelationDef { Relation::City.def() } } impl Related for Entity { fn to() -> RelationDef { Relation::Customer.def() } } impl Related for Entity { fn to() -> RelationDef { Relation::Staff.def() } } impl Related for Entity { fn to() -> RelationDef { Relation::Store.def() } } impl ActiveModelBehavior for ActiveModel {}