photon_indexer/dao/generated/
token_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 = "token_accounts")]
7pub struct Model {
8    #[sea_orm(primary_key, auto_increment = false)]
9    pub hash: Vec<u8>,
10    pub owner: Vec<u8>,
11    pub mint: Vec<u8>,
12    pub delegate: Option<Vec<u8>>,
13    pub state: i32,
14    pub spent: bool,
15    pub prev_spent: Option<bool>,
16    #[sea_orm(column_type = "Decimal(Some((20, 0)))")]
17    pub amount: Decimal,
18    pub tlv: Option<Vec<u8>>,
19}
20
21#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
22pub enum Relation {
23    #[sea_orm(
24        belongs_to = "super::accounts::Entity",
25        from = "Column::Hash",
26        to = "super::accounts::Column::Hash",
27        on_update = "NoAction",
28        on_delete = "Cascade"
29    )]
30    Accounts,
31}
32
33impl Related<super::accounts::Entity> for Entity {
34    fn to() -> RelationDef {
35        Relation::Accounts.def()
36    }
37}
38
39impl ActiveModelBehavior for ActiveModel {}