-- Migration to allow null enrollment_id and add package_id to payment_submissions
-- This enables token package purchases via the same payment flow

-- 1. Make enrollment_id nullable
ALTER TABLE payment_submissions MODIFY COLUMN enrollment_id INT NULL;

-- 2. Add package_id column
ALTER TABLE payment_submissions ADD COLUMN package_id INT NULL AFTER enrollment_id;

-- 3. Add index for package_id
CREATE INDEX idx_package_id ON payment_submissions(package_id);
