forked from aptos-labs/aptos-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Ecosystem][Indexer] Add transaction WriteSet support to Indexer
- Loading branch information
Showing
10 changed files
with
445 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
ecosystem/indexer/migrations/2022-04-19-003410_create_write_set_changes/down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
-- This file should undo anything in `up.sql` | ||
|
||
DROP TABLE IF EXISTS write_set_changes; |
25 changes: 25 additions & 0 deletions
25
ecosystem/indexer/migrations/2022-04-19-003410_create_write_set_changes/up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
-- Your SQL goes here | ||
|
||
CREATE TABLE write_set_changes | ||
( | ||
-- join from "transactions" | ||
transaction_hash VARCHAR(255) NOT NULL, | ||
|
||
hash VARCHAR(255) NOT NULL, | ||
|
||
type TEXT NOT NULL, | ||
address VARCHAR(255) NOT NULL, | ||
|
||
module jsonb NOT NULL, | ||
resource jsonb NOT NULL, | ||
data jsonb NOT NULL, | ||
inserted_at TIMESTAMP NOT NULL DEFAULT NOW(), | ||
|
||
-- Constraints | ||
PRIMARY KEY (transaction_hash, hash), | ||
CONSTRAINT fk_transactions | ||
FOREIGN KEY (transaction_hash) | ||
REFERENCES transactions (hash) | ||
); | ||
|
||
CREATE INDEX write_set_changes_tx_hash_addr_type_index ON write_set_changes (transaction_hash, address, type); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.