|
| 1 | + CREATE TABLE IF NOT EXISTS constants ( |
| 2 | + key TEXT UNIQUE, |
| 3 | + value BYTEA |
| 4 | + ); |
| 5 | + |
| 6 | + CREATE TABLE IF NOT EXISTS airdrop_scheduled ( |
| 7 | + key TEXT UNIQUE, |
| 8 | + value BYTEA |
| 9 | + ); |
| 10 | + |
| 11 | + CREATE TABLE IF NOT EXISTS OPERATOR_COST ( |
| 12 | + id SERIAL PRIMARY KEY, |
| 13 | + hash char(64), |
| 14 | + cost bigint, |
| 15 | + used_gas bigint, |
| 16 | + sender char(40), |
| 17 | + to_address char(40) , |
| 18 | + sig char(100), |
| 19 | + status varchar(100), |
| 20 | + reason varchar(100) |
| 21 | + ); |
| 22 | + |
| 23 | + CREATE TABLE IF NOT EXISTS neon_accounts ( |
| 24 | + neon_account CHAR(42), |
| 25 | + pda_account VARCHAR(50), |
| 26 | + code_account VARCHAR(50), |
| 27 | + slot BIGINT, |
| 28 | + code TEXT, |
| 29 | + |
| 30 | + UNIQUE(pda_account, code_account) |
| 31 | + ); |
| 32 | + |
| 33 | + CREATE TABLE IF NOT EXISTS failed_airdrop_attempts ( |
| 34 | + attempt_time BIGINT, |
| 35 | + eth_address TEXT, |
| 36 | + reason TEXT |
| 37 | + ); |
| 38 | + CREATE INDEX IF NOT EXISTS failed_attempt_time_idx ON failed_airdrop_attempts (attempt_time); |
| 39 | + |
| 40 | + CREATE TABLE IF NOT EXISTS airdrop_ready ( |
| 41 | + eth_address TEXT UNIQUE, |
| 42 | + scheduled_ts BIGINT, |
| 43 | + finished_ts BIGINT, |
| 44 | + duration INTEGER, |
| 45 | + amount_galans INTEGER |
| 46 | + ); |
| 47 | + |
| 48 | + CREATE TABLE IF NOT EXISTS solana_block ( |
| 49 | + slot BIGINT, |
| 50 | + hash CHAR(66), |
| 51 | + |
| 52 | + parent_hash CHAR(66), |
| 53 | + blocktime BIGINT, |
| 54 | + signatures BYTEA, |
| 55 | + |
| 56 | + UNIQUE(slot), |
| 57 | + UNIQUE(hash) |
| 58 | + ); |
| 59 | + |
| 60 | + CREATE TABLE IF NOT EXISTS neon_transaction_logs ( |
| 61 | + address CHAR(42), |
| 62 | + blockHash CHAR(66), |
| 63 | + blockNumber BIGINT, |
| 64 | + |
| 65 | + transactionHash CHAR(66), |
| 66 | + transactionLogIndex INT, |
| 67 | + topic TEXT, |
| 68 | + |
| 69 | + json TEXT, |
| 70 | + |
| 71 | + UNIQUE(blockNumber, transactionHash, transactionLogIndex) |
| 72 | + ); |
| 73 | + CREATE INDEX IF NOT EXISTS neon_transaction_logs_block_hash ON neon_transaction_logs(blockHash); |
| 74 | + CREATE INDEX IF NOT EXISTS neon_transaction_logs_address ON neon_transaction_logs(address); |
| 75 | + CREATE INDEX IF NOT EXISTS neon_transaction_logs_topic ON neon_transaction_logs(topic); |
| 76 | + |
| 77 | + CREATE TABLE IF NOT EXISTS solana_neon_transactions ( |
| 78 | + sol_sign CHAR(88), |
| 79 | + neon_sign CHAR(66), |
| 80 | + slot BIGINT, |
| 81 | + idx INT, |
| 82 | + |
| 83 | + UNIQUE(sol_sign, neon_sign, idx), |
| 84 | + UNIQUE(neon_sign, sol_sign, idx) |
| 85 | + ); |
| 86 | + |
| 87 | + CREATE TABLE IF NOT EXISTS neon_transactions ( |
| 88 | + neon_sign CHAR(66), |
| 89 | + from_addr CHAR(42), |
| 90 | + sol_sign CHAR(88), |
| 91 | + slot BIGINT, |
| 92 | + block_hash CHAR(66), |
| 93 | + idx INT, |
| 94 | + |
| 95 | + nonce VARCHAR, |
| 96 | + gas_price VARCHAR, |
| 97 | + gas_limit VARCHAR, |
| 98 | + value VARCHAR, |
| 99 | + gas_used VARCHAR, |
| 100 | + |
| 101 | + to_addr CHAR(42), |
| 102 | + contract CHAR(42), |
| 103 | + |
| 104 | + status CHAR(3), |
| 105 | + |
| 106 | + return_value TEXT, |
| 107 | + |
| 108 | + v TEXT, |
| 109 | + r TEXT, |
| 110 | + s TEXT, |
| 111 | + |
| 112 | + calldata TEXT, |
| 113 | + logs BYTEA, |
| 114 | + |
| 115 | + UNIQUE(neon_sign), |
| 116 | + UNIQUE(sol_sign, idx) |
| 117 | + ); |
| 118 | + |
| 119 | + CREATE TABLE IF NOT EXISTS transaction_receipts ( |
| 120 | + slot BIGINT, |
| 121 | + signature VARCHAR(88), |
| 122 | + trx BYTEA, |
| 123 | + PRIMARY KEY (slot, signature) |
| 124 | + ); |
| 125 | + |
| 126 | + CREATE TABLE IF NOT EXISTS constants ( |
| 127 | + key TEXT UNIQUE, |
| 128 | + value BYTEA |
| 129 | + ) |
| 130 | + |
| 131 | + CREATE TABLE IF NOT EXISTS airdrop_scheduled ( |
| 132 | + key TEXT UNIQUE, |
| 133 | + value BYTEA |
| 134 | + ) |
| 135 | + |
| 136 | + CREATE TABLE IF NOT EXISTS transaction_receipts ( |
| 137 | + slot BIGINT, |
| 138 | + signature VARCHAR(88), |
| 139 | + trx BYTEA, |
| 140 | + PRIMARY KEY (slot, signature) |
| 141 | + ); |
| 142 | + |
| 143 | + CREATE TABLE IF NOT EXISTS test_storage ( |
| 144 | + slot BIGINT, |
| 145 | + signature VARCHAR(88), |
| 146 | + trx BYTEA, |
| 147 | + PRIMARY KEY (slot, signature) |
| 148 | + ); |
0 commit comments