bbgo_origin/migrations/mysql/20241115165059_add_net_profit_column.sql

18 lines
285 B
MySQL
Raw Permalink Normal View History

-- +up
-- +begin
ALTER TABLE `positions`
ADD COLUMN `net_profit` DECIMAL(16, 8) DEFAULT 0.00000000 NOT NULL
;
-- +end
2024-11-15 10:02:32 +00:00
-- +begin
UPDATE positions SET net_profit = profit WHERE net_profit = 0.0;
-- +end
-- +down
-- +begin
ALTER TABLE `positions`
DROP COLUMN `net_profit`
;
-- +end