-- Fix ms_product_subs to support product-specific plans
-- Step 1: Remove FK constraint on plan_id
ALTER TABLE `ms_product_subs` DROP FOREIGN KEY `ms_product_subs_ibfk_3`;

-- Step 2: Add product_plan_id column to link to ms_product_plans
ALTER TABLE `ms_product_subs` 
  ADD COLUMN `product_plan_id` INT UNSIGNED NULL DEFAULT NULL AFTER `plan_id`,
  ADD INDEX `idx_product_plan` (`product_plan_id`);

-- Now plan_id is just a free text label (monthly/yearly/etc.)
-- product_plan_id links to ms_product_plans table
