bbgo_origin/migrations/sqlite3/20210223080622_add_rewards_table.sql

31 lines
690 B
MySQL
Raw Normal View History

-- !txn
2021-02-23 01:23:02 +00:00
-- +up
CREATE TABLE `rewards`
(
2021-02-23 01:37:06 +00:00
`gid` INTEGER PRIMARY KEY AUTOINCREMENT,
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) 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
);
-- +down
DROP TABLE IF EXISTS `rewards`;