View difference between Paste ID: huhbVPDT and Ssybv1qY
SHOW: | | - or go back to the newest paste.
1-
CREATE TABLE ccmd_wallets_txs (
1+
CREATE TABLE wp_wallets_txs (
2
                               id int(10) UNSIGNED NOT NULL,
3
                               blog_id bigint(20) NOT NULL DEFAULT '1' COMMENT 'blog_id for multisite installs',
4
                               category enum('deposit','move','withdraw') NOT NULL COMMENT 'type of transaction',
5
                               tags varchar(255) NOT NULL DEFAULT '' COMMENT 'space separated list of tags, slugs, etc that further describe the type of transaction',
6-
                               account bigint(20) UNSIGNED NOT NULL COMMENT 'ccmd_users.ID',
6+
                               account bigint(20) UNSIGNED NOT NULL COMMENT 'wp_users.ID',
7-
                               other_account bigint(20) UNSIGNED DEFAULT NULL COMMENT 'ccmd_users.ID when category==move',
7+
                               other_account bigint(20) UNSIGNED DEFAULT NULL COMMENT 'wp_users.ID when category==move',
8
                               address varchar(255) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '' COMMENT 'blockchain address when category==deposit or category==withdraw',
9
                               txid varchar(255) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL COMMENT 'blockchain transaction id',
10
                               symbol varchar(5) NOT NULL COMMENT 'coin symbol (e.g. BTC for Bitcoin)',
11
                               amount decimal(20,10) NOT NULL COMMENT 'amount plus any fees deducted from account',
12
                               fee decimal(20,10) NOT NULL DEFAULT '0.0000000000' COMMENT 'fees deducted from account',
13
                               comment text COMMENT 'transaction comment',
14
                               created_time datetime NOT NULL COMMENT 'when transaction was entered into the system in GMT',
15
                               updated_time datetime NOT NULL COMMENT 'when transaction was last updated in GMT (e.g. for update to confirmations count)',
16
                               confirmations mediumint(8) UNSIGNED DEFAULT '0' COMMENT 'amount of confirmations received from blockchain, or null for category==move',
17
                               status enum('unconfirmed','pending','done','failed','cancelled') NOT NULL DEFAULT 'unconfirmed' COMMENT 'state of transaction',
18
                               retries tinyint(3) UNSIGNED NOT NULL DEFAULT '1' COMMENT 'retries left before a pending transaction status becomes failed',
19
                               admin_confirm tinyint(1) NOT NULL DEFAULT '0' COMMENT '1 if an admin has confirmed this transaction',
20
                               user_confirm tinyint(1) NOT NULL DEFAULT '0' COMMENT '1 if the user has confirmed this transaction over email',
21
                               nonce char(32) DEFAULT NULL COMMENT 'nonce for user to confirm via emailed link',
22
                               extra varchar(255) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL COMMENT 'extra info required by some coins such as XMR'
23
                               ) ENGINE=InnoDB;
24
25-
ALTER TABLE ccmd_wallets_txs
25+
ALTER TABLE wp_wallets_txs
26
ADD PRIMARY KEY (id),
27
ADD UNIQUE KEY uq_tx_idx (txid,symbol),
28
ADD KEY account_idx (account),
29
ADD KEY blogid_idx (blog_id);
30
31-
CREATE TABLE ccmd_wallets_adds (
31+
CREATE TABLE wp_wallets_adds (
32
                                id int(10) UNSIGNED NOT NULL,
33
                                blog_id bigint(20) NOT NULL DEFAULT '1' COMMENT 'blog_id for multisite installs',
34-
                                account bigint(20) UNSIGNED NOT NULL COMMENT 'ccmd_users.ID',
34+
                                account bigint(20) UNSIGNED NOT NULL COMMENT 'wp_users.ID',
35
                                symbol varchar(5) COLLATE latin1_bin NOT NULL COMMENT 'coin symbol (e.g. BTC for Bitcoin)',
36
                                address varchar(255) COLLATE latin1_bin NOT NULL,
37
                                created_time datetime NOT NULL COMMENT 'when address was requested in GMT',
38
                                extra varchar(255) COLLATE latin1_bin NOT NULL DEFAULT '' COMMENT 'extra info required by some coins such as XMR'
39
                                ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_bin;
40
41-
ALTER TABLE ccmd_wallets_adds
41+
ALTER TABLE wp_wallets_adds
42
ADD PRIMARY KEY (id),
43
ADD UNIQUE KEY uq_ad_idx (address,symbol,extra),
44
ADD KEY retrieve_idx (account,symbol),
45
ADD KEY lookup_idx (address);