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
f37e4e4c
Commit
f37e4e4c
authored
Jun 01, 2023
by
Hamdi Allam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
header table name
parent
f1ed32e8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
20230523_create_schema.sql
indexer/migrations/20230523_create_schema.sql
+8
-8
No files found.
indexer/migrations/20230523_create_schema.sql
View file @
f37e4e4c
...
...
@@ -2,17 +2,17 @@
* BLOCK DATA
*/
CREATE
TABLE
IF
NOT
EXISTS
l1_blocks
(
CREATE
TABLE
IF
NOT
EXISTS
l1_block
_header
s
(
hash
VARCHAR
NOT
NULL
PRIMARY
KEY
,
parent_hash
VARCHAR
NOT
NULL
,
number
NUMERIC
NOT
NULL
,
timestamp
INTEGER
NOT
NULL
,
CONSTRAINT
l1_parent_hash_fkey
FOREIGN
KEY
(
parent_hash
)
REFERENCES
l1_blocks
(
hash
)
l1_parent_hash_fkey
FOREIGN
KEY
(
parent_hash
)
REFERENCES
l1_block
_header
s
(
hash
)
);
CREATE
TABLE
IF
NOT
EXISTS
l2_blocks
(
CREATE
TABLE
IF
NOT
EXISTS
l2_block
_header
s
(
-- Block header
hash
VARCHAR
NOT
NULL
PRIMARY
KEY
,
parent_hash
VARCHAR
NOT
NULL
,
...
...
@@ -20,11 +20,11 @@ CREATE TABLE IF NOT EXISTS l2_blocks (
timestamp
INTEGER
NOT
NULL
,
-- Finalization information
l1_block_hash
VARCHAR
NOT
NULL
REFERENCES
l1_blocks
(
hash
),
l1_block_hash
VARCHAR
NOT
NULL
REFERENCES
l1_block
_header
s
(
hash
),
legacy_state_batch_index
INTEGER
,
CONSTRAINT
l2_parent_hash_fkey
FOREIGN
KEY
(
parent_hash
)
REFERENCES
l2_blocks
(
hash
)
l2_parent_hash_fkey
FOREIGN
KEY
(
parent_hash
)
REFERENCES
l2_block
_header
s
(
hash
)
);
CREATE
TABLE
IF
NOT
EXISTS
legacy_state_batches
(
...
...
@@ -34,7 +34,7 @@ CREATE TABLE IF NOT EXISTS legacy_state_batches (
prev_total
INTEGER
NOT
NULL
,
-- Finalization information
l1_block_hash
VARCHAR
NOT
NULL
REFERENCES
l1_blocks
(
hash
)
l1_block_hash
VARCHAR
NOT
NULL
REFERENCES
l1_block
_header
s
(
hash
)
);
/**
...
...
@@ -43,7 +43,7 @@ CREATE TABLE IF NOT EXISTS legacy_state_batches (
CREATE
TABLE
IF
NOT
EXISTS
l1_contract_events
(
guid
VARCHAR
NOT
NULL
PRIMARY
KEY
,
block_hash
VARCHAR
NOT
NULL
REFERENCES
l1_blocks
(
hash
),
block_hash
VARCHAR
NOT
NULL
REFERENCES
l1_block
_header
s
(
hash
),
transaction_hash
VARCHAR
NOT
NULL
,
event_signature
VARCHAR
NOT
NULL
,
log_index
INTEGER
NOT
NULL
...
...
@@ -51,7 +51,7 @@ CREATE TABLE IF NOT EXISTS l1_contract_events (
CREATE
TABLE
IF
NOT
EXISTS
l2_contract_events
(
guid
VARCHAR
NOT
NULL
PRIMARY
KEY
,
block_hash
VARCHAR
NOT
NULL
REFERENCES
l2_blocks
(
hash
),
block_hash
VARCHAR
NOT
NULL
REFERENCES
l2_block
_header
s
(
hash
),
transaction_hash
VARCHAR
NOT
NULL
,
event_signature
VARCHAR
NOT
NULL
,
log_index
INTEGER
NOT
NULL
...
...
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