-- V7 Migration: lock final channel on sale + days_to_sell + optional lead_id
ALTER TABLE sales ADD COLUMN final_channel VARCHAR(40) NOT NULL DEFAULT 'sem_canal' AFTER payment_method;
ALTER TABLE sales ADD COLUMN days_to_sell INT NULL AFTER sale_date;
ALTER TABLE sales ADD COLUMN lead_id INT NULL AFTER customer_id;
CREATE INDEX idx_sales_final_channel ON sales(final_channel);
CREATE INDEX idx_sales_sale_date ON sales(sale_date);
