photon_indexer/dao/generated/
account_transactions.rs1use sea_orm::entity::prelude::*;
4
5#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
6#[sea_orm(table_name = "account_transactions")]
7pub struct Model {
8 #[sea_orm(primary_key, auto_increment = false)]
9 pub hash: Vec<u8>,
10 #[sea_orm(primary_key, auto_increment = false)]
11 pub signature: Vec<u8>,
12}
13
14#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
15pub enum Relation {
16 #[sea_orm(
17 belongs_to = "super::accounts::Entity",
18 from = "Column::Hash",
19 to = "super::accounts::Column::Hash",
20 on_update = "NoAction",
21 on_delete = "Cascade"
22 )]
23 Accounts,
24 #[sea_orm(
25 belongs_to = "super::transactions::Entity",
26 from = "Column::Signature",
27 to = "super::transactions::Column::Signature",
28 on_update = "NoAction",
29 on_delete = "Cascade"
30 )]
31 Transactions,
32}
33
34impl Related<super::accounts::Entity> for Entity {
35 fn to() -> RelationDef {
36 Relation::Accounts.def()
37 }
38}
39
40impl Related<super::transactions::Entity> for Entity {
41 fn to() -> RelationDef {
42 Relation::Transactions.def()
43 }
44}
45
46impl ActiveModelBehavior for ActiveModel {}