Closed gibbs-shih closed 7 months ago
更新關聯schema如下:
model transaction_raw {
id Int @id @default(autoincrement())
block_hash String
block_number Int
from String
gas String
gas_price String
max_fee_per_gas String
max_priority_fee_per_gas String
hash String @unique
input String
nonce String
to String
transaction_index String
value String
type String
access_list Json
chain_id String
v String
r String
s String
parse_finished Boolean @default(false)
}
model block_raw {
id Int @id @default(autoincrement())
base_fee_per_gas String
difficulty String
extra_data String
gas_limit String
gas_used String
hash String @unique
logs_bloom String
miner String
mix_hash String
nonce String
number Int @unique
parent_hash String
receipts_root String
sha3_uncles String
size String
state_root String
timestamp String
total_difficulty String
transactions_root String
uncles Json
burnt_fees Int
transaction_count Int
transaction_finished Boolean @default(false)
transaction_receipt_finished Boolean @default(false)
parse_finished Boolean @default(false)
}
model transaction_receipt_raw { id Int @id @default(autoincrement()) block_hash String block_number Int contract_address String cumulative_gas_used String effective_gas_price String from String gas_used String logs Json logs_bloom String status String to String transaction_hash String @unique transaction_index String type String parse_finished Boolean @default(false) }
model contracts {
id Int @id @default(autoincrement())
chain_id Int?
contract_address String?
source_code String?
creator_address String?
created_timestamp DateTime?
chains chains? @relation(fields: [chain_id], references: [id])
public_tags public_tags? @relation(fields: [contract_address], references: [target])
}
model public_tags {
id Int @id @default(autoincrement())
name String?
target String? @unique
target_type String?
contracts contracts[]
addresses addresses[] @relation("public_tags")
}
model evidences {
id Int @id @default(autoincrement())
evidence_id String?
chain_id Int?
created_timestamp DateTime?
contract_address String?
state String?
content String?
creator_address String?
token_id String?
chains chains? @relation(fields: [chain_id], references: [id])
}
model chains { id Int @id chain_name String? chain_icon String? currencies currencies[] blocks blocks[] addresses addresses[] evidences evidences[] contracts contracts[] transactions transactions[] red_flags red_flags[] black_lists black_lists[] token_balances token_balances[] token_transfers token_transfers[] }
model transactions {
id Int @id @default(autoincrement())
chain_id Int?
created_timestamp DateTime?
hash String?
type String?
status String?
block_hash String?
from_address String?
to_address String?
evidence_id String?
value Int?
fee BigInt?
related_addresses String[]
chains chains? @relation(fields: [chain_id], references: [id])
blocks blocks? @relation(fields: [block_hash], references: [hash])
}
model black_lists {
id Int @id @default(autoincrement())
chain_id Int?
created_timestamp DateTime?
address_id Int? @unique
public_tag String?
chains chains? @relation(fields: [chain_id], references: [id])
addresses addresses? @relation(fields: [address_id], references: [id])
}
model review_datas { id Int @id @default(autoincrement()) target String? @unique target_type String? created_timestamp DateTime? content String? stars Int? author_address String? addresses addresses[] @relation("review_datas") }
model red_flags {
id Int @id @default(autoincrement())
chain_id Int?
created_timestamp DateTime?
red_flag_type String?
total_amount Int?
symbol String?
related_addresses String[]
related_transactions String[]
chains chains? @relation(fields: [chain_id], references: [id])
}
model blocks {
id Int @id @default(autoincrement())
chain_id Int?
created_timestamp DateTime?
miner String?
reward String?
size Int?
symbol String?
transaction_count Int?
parent_hash String?
burnt_fees Int?
hash String? @unique
number Int? @unique
transactions transactions[]
chains chains? @relation(fields: [chain_id], references: [id])
}
model token_balances {
id Int @id @default(autoincrement())
address String?
value Int?
chain_id Int?
currency_id String? @unique
chains chains? @relation(fields: [chain_id], references: [id])
currencies currencies? @relation(fields: [currency_id], references: [id])
}
model token_transfers {
id Int @id @default(autoincrement())
from_address String?
to_address String?
value Int?
chain_id Int?
currency_id String?
transaction_hash String?
index Int?
chains chains? @relation(fields: [chain_id], references: [id])
currencies currencies? @relation(fields: [currency_id], references: [id])
}
model currencies {
id String @id
risk_level String?
price Int?
volume_in_24h Int?
symbol String?
total_amount Int?
holder_count Int?
total_transfers Int?
chain_id Int?
name String?
token_transfers token_transfers[]
token_balances token_balances?
chains chains? @relation(fields: [chain_id], references: [id])
}
model addresses {
id Int @id @default(autoincrement())
chain_id Int?
created_timestamp DateTime?
address String? @unique
score Int?
latest_active_time DateTime?
risk_records risk_records[]
black_lists black_lists?
chains chains? @relation(fields: [chain_id], references: [id])
public_tags public_tags? @relation("public_tags", fields: [address], references: [target], map: "public_tags_fkey")
review_datas review_datas? @relation("review_datas", fields: [address], references: [target], map: "review_datas_fkey")
}
model risk_records {
id Int @id @default(autoincrement())
name String?
address_id Int?
created_timestamp DateTime?
addresses addresses? @relation(fields: [address_id], references: [id])
}
model codes { id Int @id @default(autoincrement()) table_name String? table_column String? value Int? meaning String? }
- 更新remote server
taking 2.5 hr
document: BFAER00002
建立資料表關聯