-- Ads workflow migration
ALTER TABLE `ads`
  ADD COLUMN `contact_phone` varchar(30) DEFAULT NULL AFTER `price`,
  ADD COLUMN `payment_reference` varchar(255) DEFAULT NULL AFTER `contact_phone`,
  ADD COLUMN `payment_status` varchar(20) NOT NULL DEFAULT 'pending' AFTER `payment_reference`,
  ADD COLUMN `workflow_state` varchar(32) NOT NULL DEFAULT 'payment_pending' AFTER `payment_status`,
  ADD COLUMN `approved_by` int DEFAULT NULL AFTER `created_by`,
  ADD COLUMN `approved_at` datetime DEFAULT NULL AFTER `approved_by`;

-- Optional helpful index
CREATE INDEX idx_ads_workflow_state ON `ads` (`workflow_state`);
CREATE INDEX idx_ads_status ON `ads` (`status`);
