-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathbalances.sql
More file actions
18 lines (17 loc) · 826 Bytes
/
balances.sql
File metadata and controls
18 lines (17 loc) · 826 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
DROP TABLE IF EXISTS balances;
CREATE TABLE balances (
-- address TEXT,
address_id INTEGER UNSIGNED, -- id of record in index_addresses
-- asset TEXT
asset_id INTEGER UNSIGNED, -- id of record in assets
quantity BIGINT UNSIGNED,
-- utxo TEXT,
utxo_id INTEGER UNSIGNED, -- id of record in index_transactions
utxo_output INTEGER UNSIGNED, -- utxo output index
-- utxo_address TEXT,
utxo_address_id INTEGER UNSIGNED -- id of record in index_addresses
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
CREATE INDEX address_id ON balances (address_id);
CREATE INDEX asset_id ON balances (asset_id);
CREATE INDEX utxo_id ON balances (utxo_id);
CREATE INDEX utxo_address_id ON balances (utxo_address_id);