diff --git a/pkg/migrations/mysql/20220520140707_kline_unique_idx.go b/pkg/migrations/mysql/20220520140707_kline_unique_idx.go index 78c2f8b95..84dfb5030 100644 --- a/pkg/migrations/mysql/20220520140707_kline_unique_idx.go +++ b/pkg/migrations/mysql/20220520140707_kline_unique_idx.go @@ -14,31 +14,6 @@ func init() { func upKlineUniqueIdx(ctx context.Context, tx rockhopper.SQLExecutor) (err error) { // This code is executed when the migration is applied. - _, err = tx.ExecContext(ctx, "TRUNCATE TABLE `binance_klines`;") - if err != nil { - return err - } - - _, err = tx.ExecContext(ctx, "TRUNCATE TABLE `max_klines`;") - if err != nil { - return err - } - - _, err = tx.ExecContext(ctx, "TRUNCATE TABLE `ftx_klines`;") - if err != nil { - return err - } - - _, err = tx.ExecContext(ctx, "TRUNCATE TABLE `kucoin_klines`;") - if err != nil { - return err - } - - _, err = tx.ExecContext(ctx, "TRUNCATE TABLE `okex_klines`;") - if err != nil { - return err - } - _, err = tx.ExecContext(ctx, "CREATE UNIQUE INDEX idx_kline_binance_unique\n ON binance_klines (`symbol`, `interval`, `start_time`);") if err != nil { return err