init
This commit is contained in:
13
entity/Cargo.toml
Normal file
13
entity/Cargo.toml
Normal file
@@ -0,0 +1,13 @@
|
||||
[package]
|
||||
name = "models"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
publish = false
|
||||
|
||||
[lib]
|
||||
name = "models"
|
||||
path = "src/lib.rs"
|
||||
|
||||
[dependencies.sea-orm]
|
||||
version = "^0.12.0"
|
||||
|
5
entity/src/lib.rs
Normal file
5
entity/src/lib.rs
Normal file
@@ -0,0 +1,5 @@
|
||||
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.4
|
||||
|
||||
pub mod prelude;
|
||||
|
||||
pub mod stats;
|
9
entity/src/prelude.rs
Normal file
9
entity/src/prelude.rs
Normal file
@@ -0,0 +1,9 @@
|
||||
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.4
|
||||
|
||||
pub use super::stats::{
|
||||
Entity as Stats,
|
||||
ActiveModel as StatsActiveModel,
|
||||
Column as StatsColumn,
|
||||
Model as StatsModel,
|
||||
PrimaryKey as ModelPrimaryKey,
|
||||
};
|
28
entity/src/stats.rs
Normal file
28
entity/src/stats.rs
Normal file
@@ -0,0 +1,28 @@
|
||||
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.4
|
||||
|
||||
use sea_orm::entity::prelude::*;
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
|
||||
#[sea_orm(table_name = "stats")]
|
||||
pub struct Model {
|
||||
/// internal ID
|
||||
#[sea_orm(primary_key)]
|
||||
pub id: i64,
|
||||
|
||||
/// group ID
|
||||
#[sea_orm(indexed)]
|
||||
pub group_id: i64,
|
||||
|
||||
/// name hanged
|
||||
#[sea_orm(indexed)]
|
||||
pub name: String,
|
||||
|
||||
/// count of hanged
|
||||
#[sea_orm(default = 0)]
|
||||
pub counts: i64,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
||||
pub enum Relation {}
|
||||
|
||||
impl ActiveModelBehavior for ActiveModel {}
|
Reference in New Issue
Block a user