photon_indexer/dao/generated/
transactions.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 = "transactions")]
7pub struct Model {
8    #[sea_orm(primary_key, auto_increment = false)]
9    pub signature: Vec<u8>,
10    pub slot: i64,
11    pub uses_compression: bool,
12    #[sea_orm(column_type = "Text", nullable)]
13    pub error: Option<String>,
14}
15
16#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
17pub enum Relation {
18    #[sea_orm(
19        belongs_to = "super::blocks::Entity",
20        from = "Column::Slot",
21        to = "super::blocks::Column::Slot",
22        on_update = "NoAction",
23        on_delete = "Cascade"
24    )]
25    Blocks,
26}
27
28impl Related<super::blocks::Entity> for Entity {
29    fn to() -> RelationDef {
30        Relation::Blocks.def()
31    }
32}
33
34impl Related<super::accounts::Entity> for Entity {
35    fn to() -> RelationDef {
36        super::account_transactions::Relation::Accounts.def()
37    }
38    fn via() -> Option<RelationDef> {
39        Some(
40            super::account_transactions::Relation::Transactions
41                .def()
42                .rev(),
43        )
44    }
45}
46
47impl ActiveModelBehavior for ActiveModel {}