From b574c25a56c11c85902e6ffe76efff26b64b4a79 Mon Sep 17 00:00:00 2001 From: c9s Date: Fri, 15 Nov 2024 18:02:32 +0800 Subject: [PATCH] migration: set net profit from profit --- migrations/mysql/20241115165059_add_net_profit_column.sql | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/migrations/mysql/20241115165059_add_net_profit_column.sql b/migrations/mysql/20241115165059_add_net_profit_column.sql index 73bdfcf50..702686276 100644 --- a/migrations/mysql/20241115165059_add_net_profit_column.sql +++ b/migrations/mysql/20241115165059_add_net_profit_column.sql @@ -4,7 +4,9 @@ ALTER TABLE `positions` ADD COLUMN `net_profit` DECIMAL(16, 8) DEFAULT 0.00000000 NOT NULL ; -- +end - +-- +begin +UPDATE positions SET net_profit = profit WHERE net_profit = 0.0; +-- +end -- +down