mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
migrations: clean up and add kucoin klines table
This commit is contained in:
parent
1da0c8e755
commit
ce07c3eda4
|
@ -1,21 +1,21 @@
|
||||||
-- +up
|
-- +up
|
||||||
-- +begin
|
-- +begin
|
||||||
ALTER TABLE `binance_klines`
|
ALTER TABLE `binance_klines`
|
||||||
ADD COLUMN `quote_volume` DECIMAL(32, 4) NOT NULL DEFAULT 0.0,
|
ADD COLUMN `quote_volume` DECIMAL(32, 8) NOT NULL DEFAULT 0.0,
|
||||||
ADD COLUMN `taker_buy_base_volume` DECIMAL(16, 8) NOT NULL DEFAULT 0.0,
|
ADD COLUMN `taker_buy_base_volume` DECIMAL(32, 8) NOT NULL DEFAULT 0.0,
|
||||||
ADD COLUMN `taker_buy_quote_volume` DECIMAL(32, 4) NOT NULL DEFAULT 0.0;
|
ADD COLUMN `taker_buy_quote_volume` DECIMAL(32, 8) NOT NULL DEFAULT 0.0;
|
||||||
-- +end
|
-- +end
|
||||||
-- +begin
|
-- +begin
|
||||||
ALTER TABLE `max_klines`
|
ALTER TABLE `max_klines`
|
||||||
ADD COLUMN `quote_volume` DECIMAL(32, 4) NOT NULL DEFAULT 0.0,
|
ADD COLUMN `quote_volume` DECIMAL(32, 8) NOT NULL DEFAULT 0.0,
|
||||||
ADD COLUMN `taker_buy_base_volume` DECIMAL(16, 8) NOT NULL DEFAULT 0.0,
|
ADD COLUMN `taker_buy_base_volume` DECIMAL(32, 8) NOT NULL DEFAULT 0.0,
|
||||||
ADD COLUMN `taker_buy_quote_volume` DECIMAL(32, 4) NOT NULL DEFAULT 0.0;
|
ADD COLUMN `taker_buy_quote_volume` DECIMAL(32, 8) NOT NULL DEFAULT 0.0;
|
||||||
-- +end
|
-- +end
|
||||||
-- +begin
|
-- +begin
|
||||||
ALTER TABLE `okex_klines`
|
ALTER TABLE `okex_klines`
|
||||||
ADD COLUMN `quote_volume` DECIMAL(32, 4) NOT NULL DEFAULT 0.0,
|
ADD COLUMN `quote_volume` DECIMAL(32, 8) NOT NULL DEFAULT 0.0,
|
||||||
ADD COLUMN `taker_buy_base_volume` DECIMAL(16, 8) NOT NULL DEFAULT 0.0,
|
ADD COLUMN `taker_buy_base_volume` DECIMAL(32, 8) NOT NULL DEFAULT 0.0,
|
||||||
ADD COLUMN `taker_buy_quote_volume` DECIMAL(32, 4) NOT NULL DEFAULT 0.0;
|
ADD COLUMN `taker_buy_quote_volume` DECIMAL(32, 8) NOT NULL DEFAULT 0.0;
|
||||||
-- +end
|
-- +end
|
||||||
|
|
||||||
-- +down
|
-- +down
|
||||||
|
|
|
@ -1,21 +0,0 @@
|
||||||
-- +up
|
|
||||||
-- +begin
|
|
||||||
ALTER TABLE binance_klines CHANGE taker_buy_base_volume taker_buy_base_volume decimal(32,8) NOT NULL;
|
|
||||||
-- +end
|
|
||||||
-- +begin
|
|
||||||
ALTER TABLE max_klines CHANGE taker_buy_base_volume taker_buy_base_volume decimal(32,8) NOT NULL;
|
|
||||||
-- +end
|
|
||||||
-- +begin
|
|
||||||
ALTER TABLE okex_klines CHANGE taker_buy_base_volume taker_buy_base_volume decimal(32,8) NOT NULL;
|
|
||||||
-- +end
|
|
||||||
|
|
||||||
-- +down
|
|
||||||
-- +begin
|
|
||||||
ALTER TABLE binance_klines CHANGE taker_buy_base_volume taker_buy_base_volume decimal(16,8) NOT NULL;
|
|
||||||
-- +end
|
|
||||||
-- +begin
|
|
||||||
ALTER TABLE max_klines CHANGE taker_buy_base_volume taker_buy_base_volume decimal(16,8) NOT NULL;
|
|
||||||
-- +end
|
|
||||||
-- +begin
|
|
||||||
ALTER TABLE okex_klines CHANGE taker_buy_base_volume taker_buy_base_volume decimal(16,8) NOT NULL;
|
|
||||||
-- +end
|
|
10
migrations/mysql/20211226022411_add_kucoin_klines.sql
Normal file
10
migrations/mysql/20211226022411_add_kucoin_klines.sql
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
-- +up
|
||||||
|
-- +begin
|
||||||
|
CREATE TABLE `kucoin_klines` LIKE `binance_klines`;
|
||||||
|
-- +end
|
||||||
|
|
||||||
|
-- +down
|
||||||
|
|
||||||
|
-- +begin
|
||||||
|
DROP TABLE `kucoin_klines`;
|
||||||
|
-- +end
|
|
@ -1,8 +0,0 @@
|
||||||
-- +up
|
|
||||||
-- +begin
|
|
||||||
-- +end
|
|
||||||
|
|
||||||
-- +down
|
|
||||||
|
|
||||||
-- +begin
|
|
||||||
-- +end
|
|
|
@ -26,5 +26,5 @@ CREATE TABLE `ftx_klines`
|
||||||
-- +down
|
-- +down
|
||||||
|
|
||||||
-- +begin
|
-- +begin
|
||||||
drop table ftx_klines;
|
DROP TABLE ftx_klines;
|
||||||
-- +end
|
-- +end
|
||||||
|
|
29
migrations/sqlite3/20211226022411_add_kucoin_klines.sql
Normal file
29
migrations/sqlite3/20211226022411_add_kucoin_klines.sql
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
-- +up
|
||||||
|
-- +begin
|
||||||
|
CREATE TABLE `kucoin_klines`
|
||||||
|
(
|
||||||
|
`gid` INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||||
|
`exchange` VARCHAR(10) NOT NULL,
|
||||||
|
`start_time` DATETIME(3) NOT NULL,
|
||||||
|
`end_time` DATETIME(3) NOT NULL,
|
||||||
|
`interval` VARCHAR(3) NOT NULL,
|
||||||
|
`symbol` VARCHAR(7) NOT NULL,
|
||||||
|
`open` DECIMAL(16, 8) NOT NULL,
|
||||||
|
`high` DECIMAL(16, 8) NOT NULL,
|
||||||
|
`low` DECIMAL(16, 8) NOT NULL,
|
||||||
|
`close` DECIMAL(16, 8) NOT NULL DEFAULT 0.0,
|
||||||
|
`volume` DECIMAL(16, 8) NOT NULL DEFAULT 0.0,
|
||||||
|
`closed` BOOLEAN NOT NULL DEFAULT TRUE,
|
||||||
|
`last_trade_id` INT NOT NULL DEFAULT 0,
|
||||||
|
`num_trades` INT NOT NULL DEFAULT 0,
|
||||||
|
`quote_volume` DECIMAL NOT NULL DEFAULT 0.0,
|
||||||
|
`taker_buy_base_volume` DECIMAL NOT NULL DEFAULT 0.0,
|
||||||
|
`taker_buy_quote_volume` DECIMAL NOT NULL DEFAULT 0.0
|
||||||
|
);
|
||||||
|
-- +end
|
||||||
|
|
||||||
|
-- +down
|
||||||
|
|
||||||
|
-- +begin
|
||||||
|
DROP TABLE kucoin_klines;
|
||||||
|
-- +end
|
Loading…
Reference in New Issue
Block a user