forked from jdogresorg/counterparty2mysql
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dispensers.sql
executable file
·33 lines (32 loc) · 1.93 KB
/
dispensers.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
27
28
29
30
31
32
33
DROP TABLE IF EXISTS dispensers;
CREATE TABLE dispensers (
tx_index INTEGER UNSIGNED,
-- tx_hash TEXT,
tx_hash_id INTEGER UNSIGNED, -- id of record in index_transactions
block_index INTEGER UNSIGNED,
-- source TEXT,
source_id INTEGER UNSIGNED, -- id of record in index_addresses
-- asset TEXT,
asset_id INTEGER UNSIGNED, -- id of record in assets table
give_quantity BIGINT, -- Tokens to vend per dispense
escrow_quantity BIGINT, -- Tokens to escrow in dispenser
satoshirate BIGINT, -- Bitcoin satoshis required per dispense
give_remaining BIGINT,
oracle_address_id INTEGER UNSIGNED, -- id of record in index_addresses table
last_status_tx_hash_id INTEGER UNSIGNED, -- id of record in index_transactions
origin_id INTEGER UNSIGNED, -- id of record in index_addresses
closing_reason TEXT,
status TEXT,
dispense_count INTEGER DEFAULT 0,
last_status_tx_source_id INTEGER UNSIGNED,
close_block_index INTEGER UNSIGNED
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
CREATE UNIQUE INDEX tx_index ON dispensers (tx_index);
CREATE INDEX tx_hash_id ON dispensers (tx_hash_id);
CREATE INDEX block_index ON dispensers (block_index);
CREATE INDEX source_id ON dispensers (source_id);
CREATE INDEX asset_id ON dispensers (asset_id);
CREATE INDEX oracle_address_id ON dispensers (oracle_address_id);
CREATE INDEX last_status_tx_hash_id ON dispensers (last_status_tx_hash_id);
CREATE INDEX origin_id ON dispensers (origin_id);
CREATE INDEX last_status_tx_source_id ON dispensers (last_status_tx_source_id);