bbgo_origin/migrations/20200721225616_trades.sql

24 lines
683 B
MySQL
Raw Normal View History

2020-10-05 09:51:01 +00:00
-- +goose Up
CREATE TABLE `trades` (
`gid` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
`id` BIGINT UNSIGNED,
`exchange` VARCHAR(24) NOT NULL DEFAULT '',
2020-12-11 09:53:22 +00:00
`symbol` VARCHAR(8) NOT NULL,
2020-10-05 09:51:01 +00:00
`price` DECIMAL(16, 8) UNSIGNED NOT NULL,
`quantity` DECIMAL(16, 8) UNSIGNED NOT NULL,
`quote_quantity` DECIMAL(16, 8) UNSIGNED NOT NULL,
`fee` DECIMAL(16, 8) UNSIGNED NOT NULL,
`fee_currency` VARCHAR(4) NOT NULL,
`is_buyer` BOOLEAN NOT NULL DEFAULT FALSE,
`is_maker` BOOLEAN NOT NULL DEFAULT FALSE,
`side` VARCHAR(4) NOT NULL DEFAULT '',
2020-11-05 05:41:55 +00:00
`traded_at` DATETIME(3) NOT NULL,
2020-10-05 09:51:01 +00:00
PRIMARY KEY (`gid`),
UNIQUE KEY `id` (`id`)
) ENGINE=InnoDB;
-- +goose Down
DROP TABLE `trades`;