mirror of
https://github.com/grassrootseconomics/cic-custodial.git
synced 2026-05-20 03:01:08 +02:00
wip: refactor taskers
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
-- Keystore table
|
||||
CREATE TABLE IF NOT EXISTS keystore (
|
||||
id INT GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
|
||||
public_key TEXT NOT NULL,
|
||||
|
||||
23
migrations/002_custodial_db.sql
Normal file
23
migrations/002_custodial_db.sql
Normal file
@@ -0,0 +1,23 @@
|
||||
-- Origin tx table
|
||||
CREATE TABLE IF NOT EXISTS otx (
|
||||
id INT GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
|
||||
tracking_id TEXT NOT NULL,
|
||||
raw_tx TEXT NOT NULL,
|
||||
tx_hash TEXT NOT NULL,
|
||||
from TEXT NOT NULL,
|
||||
data TEXT NOT NULL,
|
||||
gas_price bigint NOT NULL,
|
||||
nonce int NOT NULL,
|
||||
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||
)
|
||||
CREATE INDEX IF NOT EXISTS tx_hash_idx ON otx USING hash(tx_hash);
|
||||
CREATE INDEX IF NOT EXISTS from_idx ON otx USING hash(from);
|
||||
|
||||
-- Dispatch status table
|
||||
CREATE TABLE IF NOT EXISTS dispatch (
|
||||
id INT GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
|
||||
otx_id INT REFERENCES otx(id),
|
||||
status TEXT NOT NULL,
|
||||
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||
)
|
||||
CREATE INDEX IF NOT EXISTS dispatch_receipt_idx ON dispatch USING hash(dispatch_receipt);
|
||||
Reference in New Issue
Block a user