-- Add missing columns to create_orders table
-- This fixes the "Undefined array key" warnings

-- Add api_txn_id column if it doesn't exist
ALTER TABLE `create_orders` 
ADD COLUMN IF NOT EXISTS `api_txn_id` VARCHAR(100) DEFAULT NULL AFTER `transactions_id`;

-- Add callback_sent column if it doesn't exist
ALTER TABLE `create_orders` 
ADD COLUMN IF NOT EXISTS `callback_sent` TINYINT(1) DEFAULT 0 AFTER `utr_number`;

-- Add index for better performance
ALTER TABLE `create_orders` 
ADD INDEX IF NOT EXISTS `idx_callback_sent` (`callback_sent`);
