-
Notifications
You must be signed in to change notification settings - Fork 11
/
dispenses.sql
26 lines (25 loc) · 1.44 KB
/
dispenses.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
DROP TABLE IF EXISTS dispenses;
CREATE TABLE dispenses (
id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
tx_index INTEGER UNSIGNED, -- TX index
dispense_index INTEGER UNSIGNED,
-- tx_hash TEXT,
tx_hash_id INTEGER UNSIGNED, -- id of record in index_transactions
block_index INTEGER UNSIGNED, -- Block which the dispense took place
-- source TEXT,
source_id INTEGER UNSIGNED, -- id of record in index_addresses
-- destination TEXT,
destination_id INTEGER UNSIGNED, -- id of record in index_addresses
-- asset TEXT,
asset_id INTEGER UNSIGNED, -- id of record in assets table
dispense_quantity BIGINT UNSIGNED,
-- dispenser_tx_hash TEXT
dispenser_tx_hash_id INTEGER UNSIGNED, -- id of record in index_transactions
btc_amount INTEGER UNSIGNED DEFAULT 0
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
CREATE INDEX block_index ON dispenses (block_index);
CREATE INDEX tx_hash_id ON dispenses (tx_hash_id);
CREATE INDEX dispenser_tx_hash_id ON dispenses (dispenser_tx_hash_id);
CREATE INDEX source_id ON dispenses (source_id);
CREATE INDEX destination_id ON dispenses (destination_id);
CREATE INDEX asset_id ON dispenses (asset_id);