bbgo_origin/migrations/mysql/20210223080622_add_rewards_table.sql

33 lines
847 B
MySQL
Raw Normal View History

2021-02-23 01:23:02 +00:00
-- +up
CREATE TABLE `rewards`
(
2021-02-23 01:37:06 +00:00
`gid` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
2021-02-23 01:23:02 +00:00
-- for exchange
2021-02-23 01:37:06 +00:00
`exchange` VARCHAR(24) NOT NULL DEFAULT '',
2021-02-23 01:23:02 +00:00
-- reward record id
2021-02-23 01:37:06 +00:00
`uuid` VARCHAR(32) NOT NULL,
`reward_type` VARCHAR(24) NOT NULL DEFAULT '',
2021-02-23 01:23:02 +00:00
-- currency symbol, BTC, MAX, USDT ... etc
2021-02-23 01:37:06 +00:00
`currency` VARCHAR(5) NOT NULL,
2021-02-23 01:23:02 +00:00
-- the quantity of the rewards
2021-02-23 01:37:06 +00:00
`quantity` DECIMAL(16, 8) UNSIGNED NOT NULL,
2021-02-23 01:23:02 +00:00
2021-02-23 01:37:06 +00:00
`state` VARCHAR(5) NOT NULL,
2021-02-23 01:23:02 +00:00
2021-02-23 01:37:06 +00:00
`created_at` DATETIME NOT NULL,
2021-02-23 01:23:02 +00:00
`spent` BOOLEAN NOT NULL DEFAULT FALSE,
2021-02-23 01:23:02 +00:00
2021-02-23 01:37:06 +00:00
`note` TEXT NULL,
2021-02-23 01:23:02 +00:00
PRIMARY KEY (`gid`),
UNIQUE KEY `uuid` (`exchange`, `uuid`)
2021-02-23 01:23:02 +00:00
);
-- +down
DROP TABLE IF EXISTS `rewards`;