compile and update migration package

This commit is contained in:
c9s 2022-06-17 14:00:36 +08:00
parent f13e39ad1d
commit daaa3352d7
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -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