use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "accounts")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub hash: Vec<u8>,
pub data: Option<Vec<u8>>,
pub data_hash: Option<Vec<u8>>,
pub address: Option<Vec<u8>>,
pub owner: Vec<u8>,
pub tree: Vec<u8>,
pub leaf_index: i64,
pub seq: Option<i64>,
pub slot_updated: i64,
pub spent: bool,
#[sea_orm(column_type = "Decimal(Some((20, 0)))")]
pub lamports: Decimal,
#[sea_orm(column_type = "Decimal(Some((20, 0)))", nullable)]
pub discriminator: Option<Decimal>,
}
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {
#[sea_orm(has_many = "super::account_transactions::Entity")]
AccountTransactions,
#[sea_orm(has_many = "super::token_accounts::Entity")]
TokenAccounts,
}
impl Related<super::account_transactions::Entity> for Entity {
fn to() -> RelationDef {
Relation::AccountTransactions.def()
}
}
impl Related<super::token_accounts::Entity> for Entity {
fn to() -> RelationDef {
Relation::TokenAccounts.def()
}
}
impl ActiveModelBehavior for ActiveModel {}