-- Migration: Add created_by column to ambulance_requests table
-- This column tracks which admin user created the request (nullable, can be NULL for user-created requests)

ALTER TABLE ambulance_requests 
ADD COLUMN created_by INT NULL AFTER request_by;

ALTER TABLE ambulance_requests 
ADD CONSTRAINT fk_created_by 
FOREIGN KEY (created_by) REFERENCES users(id) ON DELETE SET NULL;

ALTER TABLE ambulance_requests 
ADD INDEX idx_created_by (created_by);

