mirror of
https://git.ngram.ca/OpenJam/rc-servers
synced 2026-08-23 23:08:52 +00:00
Create RC database layer
This commit is contained in:
1 parent
69c6c54650
commit
77ddeb7891
55 files changed
+2689
-395
No files matched your search
@@ -0,0 +1,31 @@
|
||||
use sea_orm::entity::prelude::*;
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel)]
|
||||
#[sea_orm(table_name = "campaigns_completion")]
|
||||
pub struct Model {
|
||||
#[sea_orm(primary_key)]
|
||||
pub id: u32,
|
||||
pub campaign_id: u32,
|
||||
pub creation_time: i64, // seconds since unix epoch
|
||||
pub level: u32,
|
||||
pub wave: u32,
|
||||
pub complete: bool,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||
pub enum Relation {
|
||||
#[sea_orm(
|
||||
belongs_to = "super::campaign::Entity",
|
||||
from = "Column::CampaignId",
|
||||
to = "super::campaign::Column::Id"
|
||||
)]
|
||||
Campaign,
|
||||
}
|
||||
|
||||
impl Related<super::campaign::Entity> for Entity {
|
||||
fn to() -> RelationDef {
|
||||
Relation::Campaign.def()
|
||||
}
|
||||
}
|
||||
|
||||
impl ActiveModelBehavior for ActiveModel {}
|
||||
Reference in new issue
Block a user