Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
cda3e086
Commit
cda3e086
authored
Aug 17, 2023
by
Will Cory
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(indexer): Update prisma schema to latest
use env("DATABASE_URL")
parent
7380b85f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
180 additions
and
83 deletions
+180
-83
schema.prisma
indexer/ui/schema.prisma
+180
-83
No files found.
indexer/ui/schema.prisma
View file @
cda3e086
...
...
@@ -7,103 +7,200 @@ datasource db {
url
=
env
(
"DATABASE_URL"
)
}
model
airdrops
{
address
String
@
id
@
db
.
VarChar
(
42
)
voter_amount
String
@
default
(
"0"
)
@
db
.
VarChar
multisig_signer_amount
String
@
default
(
"0"
)
@
db
.
VarChar
gitcoin_amount
String
@
default
(
"0"
)
@
db
.
VarChar
active_bridged_amount
String
@
default
(
"0"
)
@
db
.
VarChar
op_user_amount
String
@
default
(
"0"
)
@
db
.
VarChar
op_repeat_user_amount
String
@
default
(
"0"
)
@
db
.
VarChar
op_og_amount
String
@
default
(
"0"
)
@
db
.
VarChar
bonus_amount
String
@
default
(
"0"
)
@
db
.
VarChar
total_amount
String
@
db
.
VarChar
model
l1_tokens
{
address
String
@
id
@
db
.
VarChar
bridge_address
String
@
db
.
VarChar
l2_token_address
String
@
db
.
VarChar
name
String
@
db
.
VarChar
symbol
String
@
db
.
VarChar
decimals
Int
l2_tokens
l2_tokens
[]
}
model
deposits
{
guid
String
@
id
@
db
.
VarChar
from_address
String
@
db
.
VarChar
to_address
String
@
db
.
VarChar
l1_token
String
@
db
.
VarChar
l2_token
String
@
db
.
VarChar
amount
String
@
db
.
VarChar
data
Bytes
log_index
Int
block_hash
String
@
db
.
VarChar
tx_hash
String
@
db
.
VarChar
l1_blocks
l1_blocks
@
relation
(
fields
:
[
block_hash
],
references
:
[
hash
],
onDelete
:
NoAction
,
onUpdate
:
NoAction
)
l1_tokens
l1_tokens
@
relation
(
fields
:
[
l1_token
],
references
:
[
address
],
onDelete
:
NoAction
,
onUpdate
:
NoAction
)
model
l2_tokens
{
address
String
@
id
@
db
.
VarChar
bridge_address
String
@
db
.
VarChar
l1_token_address
String
?
@
db
.
VarChar
name
String
@
db
.
VarChar
symbol
String
@
db
.
VarChar
decimals
Int
l1_tokens
l1_tokens
?
@
relation
(
fields
:
[
l1_token_address
],
references
:
[
address
],
onDelete
:
NoAction
,
onUpdate
:
NoAction
)
}
model
l1_blocks
{
hash
String
@
id
@
db
.
VarChar
parent_hash
String
@
db
.
VarChar
number
Int
@
unique
(
map
:
"l1_blocks_number"
)
timestamp
Int
deposits
deposits
[]
state_batches
state_batches
[]
///
This
table
contains
check
constraints
and
requires
additional
setup
for
migrations
.
Visit
https
://
pris
.
ly
/
d
/
check
-
constraints
for
more
info
.
model
l1_block_headers
{
hash
String
@
id
@
db
.
VarChar
parent_hash
String
@
db
.
VarChar
number
Decimal
@
db
.
Decimal
timestamp
Int
rlp_bytes
String
@
db
.
VarChar
l1_contract_events
l1_contract_events
[]
}
model
l1_tokens
{
address
String
@
id
@
db
.
VarChar
name
String
@
db
.
VarChar
symbol
String
@
db
.
VarChar
decimals
Int
deposits
deposits
[]
///
This
table
contains
check
constraints
and
requires
additional
setup
for
migrations
.
Visit
https
://
pris
.
ly
/
d
/
check
-
constraints
for
more
info
.
model
l1_bridge_deposits
{
transaction_source_hash
String
@
id
@
db
.
VarChar
cross_domain_message_hash
String
?
@
unique
@
db
.
VarChar
from_address
String
@
db
.
VarChar
to_address
String
@
db
.
VarChar
local_token_address
String
@
db
.
VarChar
remote_token_address
String
@
db
.
VarChar
amount
Decimal
@
db
.
Decimal
data
String
@
db
.
VarChar
timestamp
Int
l1_bridge_messages
l1_bridge_messages
?
@
relation
(
fields
:
[
cross_domain_message_hash
],
references
:
[
message_hash
],
onDelete
:
NoAction
,
onUpdate
:
NoAction
)
l1_transaction_deposits
l1_transaction_deposits
@
relation
(
fields
:
[
transaction_source_hash
],
references
:
[
source_hash
],
onDelete
:
NoAction
,
onUpdate
:
NoAction
)
}
model
l2_blocks
{
hash
String
@
id
@
db
.
VarChar
parent_hash
String
@
db
.
VarChar
number
Int
@
unique
(
map
:
"l2_blocks_number"
)
timestamp
Int
withdrawals
withdrawals
[]
///
This
table
contains
check
constraints
and
requires
additional
setup
for
migrations
.
Visit
https
://
pris
.
ly
/
d
/
check
-
constraints
for
more
info
.
model
l1_bridge_messages
{
message_hash
String
@
id
@
db
.
VarChar
nonce
Decimal
@
unique
@
db
.
Decimal
transaction_source_hash
String
@
unique
@
db
.
VarChar
sent_message_event_guid
String
@
unique
@
db
.
VarChar
relayed_message_event_guid
String
?
@
unique
@
db
.
VarChar
from_address
String
@
db
.
VarChar
to_address
String
@
db
.
VarChar
amount
Decimal
@
db
.
Decimal
gas_limit
Decimal
@
db
.
Decimal
data
String
@
db
.
VarChar
timestamp
Int
l1_bridge_deposits
l1_bridge_deposits
?
l2_contract_events
l2_contract_events
?
@
relation
(
fields
:
[
relayed_message_event_guid
],
references
:
[
guid
],
onDelete
:
NoAction
,
onUpdate
:
NoAction
)
l1_contract_events
l1_contract_events
@
relation
(
fields
:
[
sent_message_event_guid
],
references
:
[
guid
],
onDelete
:
NoAction
,
onUpdate
:
NoAction
)
l1_transaction_deposits
l1_transaction_deposits
@
relation
(
fields
:
[
transaction_source_hash
],
references
:
[
source_hash
],
onDelete
:
NoAction
,
onUpdate
:
NoAction
)
}
model
l2_tokens
{
address
String
@
id
name
String
symbol
String
decimals
Int
withdrawals
withdrawals
[]
///
This
table
contains
check
constraints
and
requires
additional
setup
for
migrations
.
Visit
https
://
pris
.
ly
/
d
/
check
-
constraints
for
more
info
.
model
l1_contract_events
{
guid
String
@
id
@
db
.
VarChar
block_hash
String
@
db
.
VarChar
contract_address
String
@
db
.
VarChar
transaction_hash
String
@
db
.
VarChar
log_index
Int
event_signature
String
@
db
.
VarChar
timestamp
Int
rlp_bytes
String
@
db
.
VarChar
l1_bridge_messages
l1_bridge_messages
?
l1_block_headers
l1_block_headers
@
relation
(
fields
:
[
block_hash
],
references
:
[
hash
],
onDelete
:
NoAction
,
onUpdate
:
NoAction
)
l1_transaction_deposits
l1_transaction_deposits
[]
l2_bridge_messages
l2_bridge_messages
?
l2_transaction_withdrawals_l2_transaction_withdrawals_finalized_l1_event_guidTol1_contract_events
l2_transaction_withdrawals
[]
@
relation
(
"l2_transaction_withdrawals_finalized_l1_event_guidTol1_contract_events"
)
l2_transaction_withdrawals_l2_transaction_withdrawals_proven_l1_event_guidTol1_contract_events
l2_transaction_withdrawals
[]
@
relation
(
"l2_transaction_withdrawals_proven_l1_event_guidTol1_contract_events"
)
legacy_state_batches
legacy_state_batches
[]
output_proposals
output_proposals
[]
}
///
This
table
contains
check
constraints
and
requires
additional
setup
for
migrations
.
Visit
https
://
pris
.
ly
/
d
/
check
-
constraints
for
more
info
.
model
l1_transaction_deposits
{
source_hash
String
@
id
@
db
.
VarChar
l2_transaction_hash
String
@
db
.
VarChar
initiated_l1_event_guid
String
@
db
.
VarChar
from_address
String
@
db
.
VarChar
to_address
String
@
db
.
VarChar
amount
Decimal
@
db
.
Decimal
gas_limit
Decimal
@
db
.
Decimal
data
String
@
db
.
VarChar
timestamp
Int
l1_bridge_deposits
l1_bridge_deposits
?
l1_bridge_messages
l1_bridge_messages
?
l1_contract_events
l1_contract_events
@
relation
(
fields
:
[
initiated_l1_event_guid
],
references
:
[
guid
],
onDelete
:
NoAction
,
onUpdate
:
NoAction
)
}
///
This
table
contains
check
constraints
and
requires
additional
setup
for
migrations
.
Visit
https
://
pris
.
ly
/
d
/
check
-
constraints
for
more
info
.
model
l2_block_headers
{
hash
String
@
id
@
db
.
VarChar
parent_hash
String
@
db
.
VarChar
number
Decimal
@
db
.
Decimal
timestamp
Int
rlp_bytes
String
@
db
.
VarChar
l2_contract_events
l2_contract_events
[]
}
///
This
table
contains
check
constraints
and
requires
additional
setup
for
migrations
.
Visit
https
://
pris
.
ly
/
d
/
check
-
constraints
for
more
info
.
model
l2_bridge_messages
{
message_hash
String
@
id
@
db
.
VarChar
nonce
Decimal
@
unique
@
db
.
Decimal
transaction_withdrawal_hash
String
@
unique
@
db
.
VarChar
sent_message_event_guid
String
@
unique
@
db
.
VarChar
relayed_message_event_guid
String
?
@
unique
@
db
.
VarChar
from_address
String
@
db
.
VarChar
to_address
String
@
db
.
VarChar
amount
Decimal
@
db
.
Decimal
gas_limit
Decimal
@
db
.
Decimal
data
String
@
db
.
VarChar
timestamp
Int
l1_contract_events
l1_contract_events
?
@
relation
(
fields
:
[
relayed_message_event_guid
],
references
:
[
guid
],
onDelete
:
NoAction
,
onUpdate
:
NoAction
)
l2_contract_events
l2_contract_events
@
relation
(
fields
:
[
sent_message_event_guid
],
references
:
[
guid
],
onDelete
:
NoAction
,
onUpdate
:
NoAction
)
l2_transaction_withdrawals
l2_transaction_withdrawals
@
relation
(
fields
:
[
transaction_withdrawal_hash
],
references
:
[
withdrawal_hash
],
onDelete
:
NoAction
,
onUpdate
:
NoAction
)
l2_bridge_withdrawals
l2_bridge_withdrawals
?
}
model
state_batches
{
index
Int
@
id
root
String
@
db
.
VarChar
size
Int
prev_total
Int
extra_data
Bytes
block_hash
String
@
db
.
VarChar
l1_blocks
l1_blocks
@
relation
(
fields
:
[
block_hash
],
references
:
[
hash
],
onDelete
:
NoAction
,
onUpdate
:
NoAction
)
withdrawals
withdrawals
[]
///
This
table
contains
check
constraints
and
requires
additional
setup
for
migrations
.
Visit
https
://
pris
.
ly
/
d
/
check
-
constraints
for
more
info
.
model
l2_bridge_withdrawals
{
transaction_withdrawal_hash
String
@
id
@
db
.
VarChar
cross_domain_message_hash
String
?
@
unique
@
db
.
VarChar
from_address
String
@
db
.
VarChar
to_address
String
@
db
.
VarChar
local_token_address
String
@
db
.
VarChar
remote_token_address
String
@
db
.
VarChar
amount
Decimal
@
db
.
Decimal
data
String
@
db
.
VarChar
timestamp
Int
l2_bridge_messages
l2_bridge_messages
?
@
relation
(
fields
:
[
cross_domain_message_hash
],
references
:
[
message_hash
],
onDelete
:
NoAction
,
onUpdate
:
NoAction
)
l2_transaction_withdrawals
l2_transaction_withdrawals
@
relation
(
fields
:
[
transaction_withdrawal_hash
],
references
:
[
withdrawal_hash
],
onDelete
:
NoAction
,
onUpdate
:
NoAction
)
}
@@
index
([
block_hash
],
map
:
"state_batches_block_hash"
)
@@
index
([
prev_total
],
map
:
"state_batches_prev_total"
)
@@
index
([
size
],
map
:
"state_batches_size"
)
///
This
table
contains
check
constraints
and
requires
additional
setup
for
migrations
.
Visit
https
://
pris
.
ly
/
d
/
check
-
constraints
for
more
info
.
model
l2_contract_events
{
guid
String
@
id
@
db
.
VarChar
block_hash
String
@
db
.
VarChar
contract_address
String
@
db
.
VarChar
transaction_hash
String
@
db
.
VarChar
log_index
Int
event_signature
String
@
db
.
VarChar
timestamp
Int
rlp_bytes
String
@
db
.
VarChar
l1_bridge_messages
l1_bridge_messages
?
l2_bridge_messages
l2_bridge_messages
?
l2_block_headers
l2_block_headers
@
relation
(
fields
:
[
block_hash
],
references
:
[
hash
],
onDelete
:
NoAction
,
onUpdate
:
NoAction
)
l2_transaction_withdrawals
l2_transaction_withdrawals
[]
}
model
withdrawals
{
guid
String
@
id
@
db
.
VarChar
from_address
String
@
db
.
VarChar
to_address
String
@
db
.
VarChar
l1_token
String
@
db
.
VarChar
l2_token
String
@
db
.
VarChar
amount
String
@
db
.
VarChar
data
Bytes
log_index
Int
block_hash
String
@
db
.
VarChar
tx_hash
String
@
db
.
VarChar
state_batch
Int
?
br_withdrawal_hash
String
?
@
db
.
VarChar
br_withdrawal_proven_tx_hash
String
?
@
db
.
VarChar
br_withdrawal_proven_log_index
Int
?
br_withdrawal_finalized_tx_hash
String
?
@
db
.
VarChar
br_withdrawal_finalized_log_index
Int
?
br_withdrawal_finalized_success
Boolean
?
l2_blocks
l2_blocks
@
relation
(
fields
:
[
block_hash
],
references
:
[
hash
],
onDelete
:
NoAction
,
onUpdate
:
NoAction
,
map
:
"l2"
)
l2_tokens
l2_tokens
@
relation
(
fields
:
[
l2_token
],
references
:
[
address
],
onDelete
:
NoAction
,
onUpdate
:
NoAction
)
state_batches
state_batches
?
@
relation
(
fields
:
[
state_batch
],
references
:
[
index
],
onDelete
:
NoAction
,
onUpdate
:
NoAction
)
///
This
table
contains
check
constraints
and
requires
additional
setup
for
migrations
.
Visit
https
://
pris
.
ly
/
d
/
check
-
constraints
for
more
info
.
model
l2_transaction_withdrawals
{
withdrawal_hash
String
@
id
@
db
.
VarChar
initiated_l2_event_guid
String
@
db
.
VarChar
proven_l1_event_guid
String
?
@
db
.
VarChar
finalized_l1_event_guid
String
?
@
db
.
VarChar
succeeded
Boolean
?
nonce
Decimal
?
@
unique
@
db
.
Decimal
from_address
String
@
db
.
VarChar
to_address
String
@
db
.
VarChar
amount
Decimal
@
db
.
Decimal
gas_limit
Decimal
@
db
.
Decimal
data
String
@
db
.
VarChar
timestamp
Int
l2_bridge_messages
l2_bridge_messages
?
l2_bridge_withdrawals
l2_bridge_withdrawals
?
l1_contract_events_l2_transaction_withdrawals_finalized_l1_event_guidTol1_contract_events
l1_contract_events
?
@
relation
(
"l2_transaction_withdrawals_finalized_l1_event_guidTol1_contract_events"
,
fields
:
[
finalized_l1_event_guid
],
references
:
[
guid
],
onDelete
:
NoAction
,
onUpdate
:
NoAction
)
l2_contract_events
l2_contract_events
@
relation
(
fields
:
[
initiated_l2_event_guid
],
references
:
[
guid
],
onDelete
:
NoAction
,
onUpdate
:
NoAction
)
l1_contract_events_l2_transaction_withdrawals_proven_l1_event_guidTol1_contract_events
l1_contract_events
?
@
relation
(
"l2_transaction_withdrawals_proven_l1_event_guidTol1_contract_events"
,
fields
:
[
proven_l1_event_guid
],
references
:
[
guid
],
onDelete
:
NoAction
,
onUpdate
:
NoAction
)
}
model
legacy_state_batches
{
index
Int
@
id
root
String
@
db
.
VarChar
size
Int
prev_total
Int
l1_contract_event_guid
String
?
@
db
.
VarChar
l1_contract_events
l1_contract_events
?
@
relation
(
fields
:
[
l1_contract_event_guid
],
references
:
[
guid
],
onDelete
:
NoAction
,
onUpdate
:
NoAction
)
}
@@
index
([
br_withdrawal_hash
],
map
:
"withdrawals_br_withdrawal_hash"
)
model
output_proposals
{
output_root
String
@
id
@
db
.
VarChar
l2_output_index
Decimal
@
db
.
Decimal
l2_block_number
Decimal
@
db
.
Decimal
l1_contract_event_guid
String
?
@
db
.
VarChar
l1_contract_events
l1_contract_events
?
@
relation
(
fields
:
[
l1_contract_event_guid
],
references
:
[
guid
],
onDelete
:
NoAction
,
onUpdate
:
NoAction
)
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment