Skip to content

Commit

Permalink
generate entities
Browse files Browse the repository at this point in the history
  • Loading branch information
bragov4ik committed Aug 29, 2024
1 parent bce2f9b commit 5560f3f
Show file tree
Hide file tree
Showing 60 changed files with 1,233 additions and 466 deletions.
34 changes: 34 additions & 0 deletions libs/blockscout-db/entity/src/account_api_keys.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.0.1
use sea_orm::entity::prelude::*;

#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "account_api_keys")]
pub struct Model {
pub identity_id: i64,
pub name: String,
#[sea_orm(primary_key, auto_increment = false)]
pub value: Uuid,
pub inserted_at: DateTime,
pub updated_at: DateTime,
}

#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {
#[sea_orm(
belongs_to = "super::account_identities::Entity",
from = "Column::IdentityId",
to = "super::account_identities::Column::Id",
on_update = "NoAction",
on_delete = "Cascade"
)]
AccountIdentities,
}

impl Related<super::account_identities::Entity> for Entity {
fn to() -> RelationDef {
Relation::AccountIdentities.def()
}
}

impl ActiveModelBehavior for ActiveModel {}
28 changes: 28 additions & 0 deletions libs/blockscout-db/entity/src/account_api_plans.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.0.1
use sea_orm::entity::prelude::*;

#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "account_api_plans")]
pub struct Model {
#[sea_orm(primary_key)]
pub id: i32,
pub max_req_per_second: Option<i16>,
pub name: String,
pub inserted_at: DateTime,
pub updated_at: DateTime,
}

#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {
#[sea_orm(has_many = "super::account_identities::Entity")]
AccountIdentities,
}

impl Related<super::account_identities::Entity> for Entity {
fn to() -> RelationDef {
Relation::AccountIdentities.def()
}
}

impl ActiveModelBehavior for ActiveModel {}
41 changes: 41 additions & 0 deletions libs/blockscout-db/entity/src/account_custom_abis.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.0.1
use sea_orm::entity::prelude::*;

#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "account_custom_abis")]
pub struct Model {
#[sea_orm(primary_key)]
pub id: i32,
pub identity_id: i64,
#[sea_orm(column_type = "JsonBinary")]
pub abi: Json,
pub inserted_at: DateTime,
pub updated_at: DateTime,
#[sea_orm(column_type = "VarBinary(StringLen::None)", nullable)]
pub address_hash_hash: Option<Vec<u8>>,
#[sea_orm(column_type = "VarBinary(StringLen::None)", nullable)]
pub address_hash: Option<Vec<u8>>,
#[sea_orm(column_type = "VarBinary(StringLen::None)", nullable)]
pub name: Option<Vec<u8>>,
}

#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {
#[sea_orm(
belongs_to = "super::account_identities::Entity",
from = "Column::IdentityId",
to = "super::account_identities::Column::Id",
on_update = "NoAction",
on_delete = "Cascade"
)]
AccountIdentities,
}

impl Related<super::account_identities::Entity> for Entity {
fn to() -> RelationDef {
Relation::AccountIdentities.def()
}
}

impl ActiveModelBehavior for ActiveModel {}
94 changes: 94 additions & 0 deletions libs/blockscout-db/entity/src/account_identities.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.0.1
use sea_orm::entity::prelude::*;

#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "account_identities")]
pub struct Model {
#[sea_orm(primary_key)]
pub id: i64,
pub inserted_at: DateTime,
pub updated_at: DateTime,
pub plan_id: Option<i64>,
#[sea_orm(column_type = "VarBinary(StringLen::None)", nullable)]
pub uid: Option<Vec<u8>>,
#[sea_orm(column_type = "VarBinary(StringLen::None)", nullable, unique)]
pub uid_hash: Option<Vec<u8>>,
#[sea_orm(column_type = "VarBinary(StringLen::None)", nullable)]
pub email: Option<Vec<u8>>,
#[sea_orm(column_type = "VarBinary(StringLen::None)", nullable)]
pub name: Option<Vec<u8>>,
#[sea_orm(column_type = "VarBinary(StringLen::None)", nullable)]
pub nickname: Option<Vec<u8>>,
#[sea_orm(column_type = "VarBinary(StringLen::None)", nullable)]
pub avatar: Option<Vec<u8>>,
pub verification_email_sent_at: Option<DateTime>,
}

#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {
#[sea_orm(has_many = "super::account_api_keys::Entity")]
AccountApiKeys,
#[sea_orm(
belongs_to = "super::account_api_plans::Entity",
from = "Column::PlanId",
to = "super::account_api_plans::Column::Id",
on_update = "NoAction",
on_delete = "NoAction"
)]
AccountApiPlans,
#[sea_orm(has_many = "super::account_custom_abis::Entity")]
AccountCustomAbis,
#[sea_orm(has_many = "super::account_public_tags_requests::Entity")]
AccountPublicTagsRequests,
#[sea_orm(has_many = "super::account_tag_addresses::Entity")]
AccountTagAddresses,
#[sea_orm(has_many = "super::account_tag_transactions::Entity")]
AccountTagTransactions,
#[sea_orm(has_many = "super::account_watchlists::Entity")]
AccountWatchlists,
}

impl Related<super::account_api_keys::Entity> for Entity {
fn to() -> RelationDef {
Relation::AccountApiKeys.def()
}
}

impl Related<super::account_api_plans::Entity> for Entity {
fn to() -> RelationDef {
Relation::AccountApiPlans.def()
}
}

impl Related<super::account_custom_abis::Entity> for Entity {
fn to() -> RelationDef {
Relation::AccountCustomAbis.def()
}
}

impl Related<super::account_public_tags_requests::Entity> for Entity {
fn to() -> RelationDef {
Relation::AccountPublicTagsRequests.def()
}
}

impl Related<super::account_tag_addresses::Entity> for Entity {
fn to() -> RelationDef {
Relation::AccountTagAddresses.def()
}
}

impl Related<super::account_tag_transactions::Entity> for Entity {
fn to() -> RelationDef {
Relation::AccountTagTransactions.def()
}
}

impl Related<super::account_watchlists::Entity> for Entity {
fn to() -> RelationDef {
Relation::AccountWatchlists.def()
}
}

impl ActiveModelBehavior for ActiveModel {}
49 changes: 49 additions & 0 deletions libs/blockscout-db/entity/src/account_public_tags_requests.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.0.1
use sea_orm::entity::prelude::*;

#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "account_public_tags_requests")]
pub struct Model {
#[sea_orm(primary_key)]
pub id: i64,
pub identity_id: Option<i64>,
pub company: Option<String>,
pub website: Option<String>,
pub tags: Option<String>,
#[sea_orm(column_type = "Text", nullable)]
pub description: Option<String>,
pub additional_comment: Option<String>,
pub request_type: Option<String>,
pub is_owner: Option<bool>,
#[sea_orm(column_type = "Text", nullable)]
pub remove_reason: Option<String>,
pub request_id: Option<String>,
pub inserted_at: DateTime,
pub updated_at: DateTime,
pub addresses: Option<Vec<Vec<u8>>>,
#[sea_orm(column_type = "VarBinary(StringLen::None)", nullable)]
pub email: Option<Vec<u8>>,
#[sea_orm(column_type = "VarBinary(StringLen::None)", nullable)]
pub full_name: Option<Vec<u8>>,
}

#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {
#[sea_orm(
belongs_to = "super::account_identities::Entity",
from = "Column::IdentityId",
to = "super::account_identities::Column::Id",
on_update = "NoAction",
on_delete = "NoAction"
)]
AccountIdentities,
}

impl Related<super::account_identities::Entity> for Entity {
fn to() -> RelationDef {
Relation::AccountIdentities.def()
}
}

impl ActiveModelBehavior for ActiveModel {}
39 changes: 39 additions & 0 deletions libs/blockscout-db/entity/src/account_tag_addresses.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.0.1
use sea_orm::entity::prelude::*;

#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "account_tag_addresses")]
pub struct Model {
#[sea_orm(primary_key)]
pub id: i64,
pub identity_id: Option<i64>,
pub inserted_at: DateTime,
pub updated_at: DateTime,
#[sea_orm(column_type = "VarBinary(StringLen::None)", nullable)]
pub address_hash_hash: Option<Vec<u8>>,
#[sea_orm(column_type = "VarBinary(StringLen::None)", nullable)]
pub name: Option<Vec<u8>>,
#[sea_orm(column_type = "VarBinary(StringLen::None)", nullable)]
pub address_hash: Option<Vec<u8>>,
}

#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {
#[sea_orm(
belongs_to = "super::account_identities::Entity",
from = "Column::IdentityId",
to = "super::account_identities::Column::Id",
on_update = "NoAction",
on_delete = "Cascade"
)]
AccountIdentities,
}

impl Related<super::account_identities::Entity> for Entity {
fn to() -> RelationDef {
Relation::AccountIdentities.def()
}
}

impl ActiveModelBehavior for ActiveModel {}
39 changes: 39 additions & 0 deletions libs/blockscout-db/entity/src/account_tag_transactions.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.0.1
use sea_orm::entity::prelude::*;

#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "account_tag_transactions")]
pub struct Model {
#[sea_orm(primary_key)]
pub id: i64,
pub identity_id: Option<i64>,
pub inserted_at: DateTime,
pub updated_at: DateTime,
#[sea_orm(column_type = "VarBinary(StringLen::None)", nullable)]
pub tx_hash_hash: Option<Vec<u8>>,
#[sea_orm(column_type = "VarBinary(StringLen::None)", nullable)]
pub name: Option<Vec<u8>>,
#[sea_orm(column_type = "VarBinary(StringLen::None)", nullable)]
pub tx_hash: Option<Vec<u8>>,
}

#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {
#[sea_orm(
belongs_to = "super::account_identities::Entity",
from = "Column::IdentityId",
to = "super::account_identities::Column::Id",
on_update = "NoAction",
on_delete = "Cascade"
)]
AccountIdentities,
}

impl Related<super::account_identities::Entity> for Entity {
fn to() -> RelationDef {
Relation::AccountIdentities.def()
}
}

impl ActiveModelBehavior for ActiveModel {}
53 changes: 53 additions & 0 deletions libs/blockscout-db/entity/src/account_watchlist_addresses.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.0.1
use sea_orm::entity::prelude::*;

#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "account_watchlist_addresses")]
pub struct Model {
#[sea_orm(primary_key)]
pub id: i64,
pub watchlist_id: Option<i64>,
pub watch_coin_input: Option<bool>,
pub watch_coin_output: Option<bool>,
pub watch_erc_20_input: Option<bool>,
pub watch_erc_20_output: Option<bool>,
pub watch_erc_721_input: Option<bool>,
pub watch_erc_721_output: Option<bool>,
pub watch_erc_1155_input: Option<bool>,
pub watch_erc_1155_output: Option<bool>,
pub notify_email: Option<bool>,
pub notify_epns: Option<bool>,
pub notify_feed: Option<bool>,
pub notify_inapp: Option<bool>,
pub inserted_at: DateTime,
pub updated_at: DateTime,
#[sea_orm(column_type = "VarBinary(StringLen::None)", nullable)]
pub address_hash_hash: Option<Vec<u8>>,
#[sea_orm(column_type = "VarBinary(StringLen::None)", nullable)]
pub name: Option<Vec<u8>>,
#[sea_orm(column_type = "VarBinary(StringLen::None)", nullable)]
pub address_hash: Option<Vec<u8>>,
pub watch_erc_404_input: Option<bool>,
pub watch_erc_404_output: Option<bool>,
}

#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {
#[sea_orm(
belongs_to = "super::account_watchlists::Entity",
from = "Column::WatchlistId",
to = "super::account_watchlists::Column::Id",
on_update = "NoAction",
on_delete = "Cascade"
)]
AccountWatchlists,
}

impl Related<super::account_watchlists::Entity> for Entity {
fn to() -> RelationDef {
Relation::AccountWatchlists.def()
}
}

impl ActiveModelBehavior for ActiveModel {}
Loading

0 comments on commit 5560f3f

Please sign in to comment.