From 966a3b3c4582e889d80cb77fbcaba082003a3ce8 Mon Sep 17 00:00:00 2001 From: c9s Date: Fri, 15 Nov 2024 18:02:50 +0800 Subject: [PATCH] compile and update migration package --- .../mysql/main_20241115165059_add_net_profit_column.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/migrations/mysql/main_20241115165059_add_net_profit_column.go b/pkg/migrations/mysql/main_20241115165059_add_net_profit_column.go index 15307b315..d17c81c34 100644 --- a/pkg/migrations/mysql/main_20241115165059_add_net_profit_column.go +++ b/pkg/migrations/mysql/main_20241115165059_add_net_profit_column.go @@ -16,6 +16,10 @@ func up_main_addNetProfitColumn(ctx context.Context, tx rockhopper.SQLExecutor) if err != nil { return err } + _, err = tx.ExecContext(ctx, "UPDATE positions SET net_profit = profit WHERE net_profit = 0.0;") + if err != nil { + return err + } return err }