2023-01-26 08:24:09 +03:00
|
|
|
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.7
|
|
|
|
|
|
|
|
use sea_orm::entity::prelude::*;
|
|
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
|
|
|
|
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
|
|
|
|
#[sea_orm(table_name = "rpc_accounting_v2")]
|
|
|
|
pub struct Model {
|
|
|
|
#[sea_orm(primary_key)]
|
|
|
|
pub id: u64,
|
2023-04-06 00:55:37 +03:00
|
|
|
pub rpc_key_id: u64,
|
2023-01-26 08:24:09 +03:00
|
|
|
pub chain_id: u64,
|
|
|
|
pub period_datetime: DateTimeUtc,
|
2023-04-06 00:55:37 +03:00
|
|
|
pub method: String,
|
|
|
|
pub origin: String,
|
2023-01-26 08:24:09 +03:00
|
|
|
pub archive_needed: bool,
|
|
|
|
pub error_response: bool,
|
|
|
|
pub frontend_requests: u64,
|
|
|
|
pub backend_requests: u64,
|
|
|
|
pub backend_retries: u64,
|
|
|
|
pub no_servers: u64,
|
|
|
|
pub cache_misses: u64,
|
|
|
|
pub cache_hits: u64,
|
|
|
|
pub sum_request_bytes: u64,
|
|
|
|
pub sum_response_millis: u64,
|
|
|
|
pub sum_response_bytes: u64,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
|
|
|
pub enum Relation {
|
|
|
|
#[sea_orm(
|
|
|
|
belongs_to = "super::rpc_key::Entity",
|
|
|
|
from = "Column::RpcKeyId",
|
|
|
|
to = "super::rpc_key::Column::Id",
|
|
|
|
on_update = "NoAction",
|
|
|
|
on_delete = "NoAction"
|
|
|
|
)]
|
|
|
|
RpcKey,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Related<super::rpc_key::Entity> for Entity {
|
|
|
|
fn to() -> RelationDef {
|
|
|
|
Relation::RpcKey.def()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl ActiveModelBehavior for ActiveModel {}
|