sql: new payouts and account fields

This commit is contained in:
Tanguy Pruvot 2017-06-14 05:41:49 +02:00
parent 45823c84c5
commit 4c7cd95fa4
2 changed files with 29 additions and 0 deletions

View file

@ -0,0 +1,9 @@
-- Recent additions to add after db init (.gz)
-- mysql yaamp -p < file.sql
-- Adds binary type to be case sensitive
ALTER TABLE accounts CHANGE `username` `username` varchar(128) binary NOT NULL;
-- Remember last coin id swap
ALTER TABLE accounts ADD `swap_time` INT(10) UNSIGNED NULL AFTER `coinsymbol`;

View file

@ -0,0 +1,20 @@
-- Recent additions to add after db init (.gz)
-- mysql yaamp -p < file.sql
-- Store coin id used on payment, memoid could be used later for xrp
ALTER TABLE `payouts`
ADD `idcoin` int(11) NULL AFTER `account_id`,
ADD `memoid` varchar(128) NULL AFTER `tx`;
ALTER TABLE `payouts` DROP COLUMN `account_ids`;
ALTER TABLE `payouts`
ADD KEY `payouts_coin` (`idcoin`);
ALTER TABLE `payouts` ADD CONSTRAINT fk_payouts_coin FOREIGN KEY (`idcoin`)
REFERENCES coins (`id`) ON DELETE CASCADE;
ALTER TABLE `payouts` ADD CONSTRAINT fk_payouts_account FOREIGN KEY (`account_id`)
REFERENCES accounts (`id`) ON DELETE CASCADE;