From 4a6c9deb8d5137d8fd89e1d60f97750d71c6fc9f Mon Sep 17 00:00:00 2001 From: c9s Date: Mon, 27 Dec 2021 19:13:21 +0800 Subject: [PATCH] compile and update migration package --- .../mysql/20210531234123_add_kline_taker_buy_columns.go | 5 +++++ .../sqlite3/20210531234123_add_kline_taker_buy_columns.go | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/pkg/migrations/mysql/20210531234123_add_kline_taker_buy_columns.go b/pkg/migrations/mysql/20210531234123_add_kline_taker_buy_columns.go index 8a656d484..3687cf0d0 100644 --- a/pkg/migrations/mysql/20210531234123_add_kline_taker_buy_columns.go +++ b/pkg/migrations/mysql/20210531234123_add_kline_taker_buy_columns.go @@ -29,6 +29,11 @@ func upAddKlineTakerBuyColumns(ctx context.Context, tx rockhopper.SQLExecutor) ( return err } + _, err = tx.ExecContext(ctx, "ALTER TABLE `klines`\n ADD COLUMN `quote_volume` DECIMAL(32, 8) NOT NULL DEFAULT 0.0,\n ADD COLUMN `taker_buy_base_volume` DECIMAL(32, 8) NOT NULL DEFAULT 0.0,\n ADD COLUMN `taker_buy_quote_volume` DECIMAL(32, 8) NOT NULL DEFAULT 0.0;") + if err != nil { + return err + } + return err } diff --git a/pkg/migrations/sqlite3/20210531234123_add_kline_taker_buy_columns.go b/pkg/migrations/sqlite3/20210531234123_add_kline_taker_buy_columns.go index d742286c4..a5f1c8c2c 100644 --- a/pkg/migrations/sqlite3/20210531234123_add_kline_taker_buy_columns.go +++ b/pkg/migrations/sqlite3/20210531234123_add_kline_taker_buy_columns.go @@ -29,6 +29,11 @@ func upAddKlineTakerBuyColumns(ctx context.Context, tx rockhopper.SQLExecutor) ( return err } + _, err = tx.ExecContext(ctx, "ALTER TABLE `klines`\n ADD COLUMN `quote_volume` DECIMAL NOT NULL DEFAULT 0.0;\nALTER TABLE `klines`\n ADD COLUMN `taker_buy_base_volume` DECIMAL NOT NULL DEFAULT 0.0;\nALTER TABLE `klines`\n ADD COLUMN `taker_buy_quote_volume` DECIMAL NOT NULL DEFAULT 0.0;") + if err != nil { + return err + } + return err }