-- 2026-06-03 CRM requested improvements
ALTER TABLE items ADD COLUMN IF NOT EXISTS currency VARCHAR(10) NULL AFTER price;
ALTER TABLE quotations ADD COLUMN IF NOT EXISTS customer_logo VARCHAR(255) NULL AFTER notes;
ALTER TABLE quotations ADD COLUMN IF NOT EXISTS customer_details TEXT NULL AFTER customer_logo;
ALTER TABLE quotations ADD COLUMN IF NOT EXISTS reminder_date DATE NULL AFTER customer_details;
ALTER TABLE quotations ADD COLUMN IF NOT EXISTS reminder_time TIME NULL AFTER reminder_date;
ALTER TABLE quotations ADD COLUMN IF NOT EXISTS reminder_note TEXT NULL AFTER reminder_time;
ALTER TABLE reminder ADD COLUMN IF NOT EXISTS quotation_id INT NULL AFTER lead_id;
UPDATE items i JOIN accounts a ON a.id=i.account_id SET i.currency=a.currency WHERE i.currency IS NULL OR i.currency='';
