-- Migration: Add margin_validation_fails column to backtest_results
-- Purpose: Track the number of times margin validation failed during backtest
-- Requirements: 10.3, 10.4, 10.5

-- Add margin_validation_fails column
ALTER TABLE backtest_results ADD COLUMN margin_validation_fails INTEGER DEFAULT 0;

-- Update existing records to have 0 margin validation fails
UPDATE backtest_results SET margin_validation_fails = 0 WHERE margin_validation_fails IS NULL;
