web3-proxy/entities/src/revert_logs.rs

39 lines
997 B
Rust
Raw Normal View History

2022-09-24 03:14:35 +03:00
//! SeaORM Entity. Generated by sea-orm-codegen 0.9.1
use super::sea_orm_active_enums::Method;
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel, Serialize, Deserialize)]
#[sea_orm(table_name = "revert_logs")]
pub struct Model {
#[sea_orm(primary_key)]
pub id: u64,
pub user_key_id: u64,
pub timestamp: DateTimeUtc,
pub method: Method,
pub to: Vec<u8>,
#[sea_orm(column_type = "Text")]
pub call_data: String,
}
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {
#[sea_orm(
belongs_to = "super::user_keys::Entity",
from = "Column::UserKeyId",
to = "super::user_keys::Column::Id",
on_update = "NoAction",
on_delete = "NoAction"
)]
UserKeys,
}
impl Related<super::user_keys::Entity> for Entity {
fn to() -> RelationDef {
Relation::UserKeys.def()
}
}
impl ActiveModelBehavior for ActiveModel {}