수정본
This commit is contained in:
11
backend/migrations/add_trade_history_columns.sql
Normal file
11
backend/migrations/add_trade_history_columns.sql
Normal file
@@ -0,0 +1,11 @@
|
||||
-- 거래 이력 테이블에 새로운 컬럼 추가
|
||||
ALTER TABLE trade_history
|
||||
ADD COLUMN IF NOT EXISTS total_amount NUMERIC(15, 2),
|
||||
ADD COLUMN IF NOT EXISTS entry_reason TEXT,
|
||||
ADD COLUMN IF NOT EXISTS exit_reason TEXT,
|
||||
ADD COLUMN IF NOT EXISTS signals JSONB;
|
||||
|
||||
-- 기존 데이터에 대한 total_amount 계산
|
||||
UPDATE trade_history
|
||||
SET total_amount = executed_price * executed_quantity
|
||||
WHERE total_amount IS NULL AND executed_price IS NOT NULL AND executed_quantity IS NOT NULL;
|
||||
Reference in New Issue
Block a user