photon_indexer/dao/generated/
accounts.rs

1//! `SeaORM` Entity. Generated by sea-orm-codegen 0.10.6
2
3use sea_orm::entity::prelude::*;
4
5#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
6#[sea_orm(table_name = "accounts")]
7pub struct Model {
8    #[sea_orm(primary_key, auto_increment = false)]
9    pub hash: Vec<u8>,
10    pub data: Option<Vec<u8>>,
11    pub data_hash: Option<Vec<u8>>,
12    pub address: Option<Vec<u8>>,
13    pub owner: Vec<u8>,
14    pub tree: Vec<u8>,
15    pub leaf_index: i64,
16    pub seq: i64,
17    pub slot_created: i64,
18    pub spent: bool,
19    pub prev_spent: Option<bool>,
20    #[sea_orm(column_type = "Decimal(Some((20, 0)))")]
21    pub lamports: Decimal,
22    #[sea_orm(column_type = "Decimal(Some((20, 0)))", nullable)]
23    pub discriminator: Option<Decimal>,
24}
25
26#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
27pub enum Relation {
28    #[sea_orm(has_many = "super::token_accounts::Entity")]
29    TokenAccounts,
30}
31
32impl Related<super::token_accounts::Entity> for Entity {
33    fn to() -> RelationDef {
34        Relation::TokenAccounts.def()
35    }
36}
37
38impl Related<super::transactions::Entity> for Entity {
39    fn to() -> RelationDef {
40        super::account_transactions::Relation::Transactions.def()
41    }
42    fn via() -> Option<RelationDef> {
43        Some(super::account_transactions::Relation::Accounts.def().rev())
44    }
45}
46
47impl ActiveModelBehavior for ActiveModel {}