-- Add referred_by column to clients table
ALTER TABLE `clients` ADD COLUMN `referred_by` BIGINT UNSIGNED NULL AFTER `assigned_staff_id`;

-- Add foreign key constraint
ALTER TABLE `clients` ADD CONSTRAINT `clients_referred_by_foreign` FOREIGN KEY (`referred_by`) REFERENCES `users`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
