ALTER TABLE `tblplans` ADD `apple_data` LONGTEXT NULL DEFAULT NULL AFTER `stripe_data`;

UPDATE tblplans SET apple_data = '{"group_id":"professional_subscription","yearly_product_id":"professional_yearly_plan","monthly_product_id":"professional_monthly_plan","monthly_product_price":"13.99","yearly_product_price":"9.99"}' WHERE codename = '7_pro';

UPDATE tblplans SET apple_data = '{"group_id":"corporate_subscription","yearly_product_id":"corporate_yearly_plan","monthly_product_id":"corporate_monthly_plan","monthly_product_price":"49.99","yearly_product_price":"29.99"}' WHERE codename = '7_pro_elite';

UPDATE tblplans SET apple_data = '{"group_id":"ultimate_subscription","yearly_product_id":"ultimate_yearly_plan","monthly_product_id":"ultimate_monthly_plan","monthly_product_price":"58.99","yearly_product_price":"99.99"}' WHERE codename = '7_pro_exclusive';

ALTER TABLE `tbltenant_plan_information` ADD `apple_subscription_id` VARCHAR(191) NULL DEFAULT NULL AFTER `stripe_subscription_id`;

ALTER TABLE `tbltenant_plan_changes_history` ADD `apple_subscription_id` VARCHAR(191) NULL DEFAULT NULL AFTER `stripe_subscription_id`;

ALTER TABLE `tbltenant_subscription_payments` CHANGE `mode` `mode` ENUM('subscription_callback','direct_via_web','cron','direct_via_ios_inapp_purchase') CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL;

ALTER TABLE `tbltenant_plan_cancellation_actions` ADD `apple_subscription_id` VARCHAR(191) NULL DEFAULT NULL AFTER `stripe_subscription_id`;
ALTER TABLE `tbltenant_plan_cancel_history` ADD `apple_subscription_id` VARCHAR(191) NULL DEFAULT NULL AFTER `stripe_subscription_id`;
ALTER TABLE `tbltenant_plan_cancel_history` ADD `apple_response` LONGTEXT NULL DEFAULT NULL AFTER `stripe_response`;

ALTER TABLE `tbltenant_plan_cancel_history` CHANGE `stripe_subscription_id` `stripe_subscription_id` VARCHAR(191) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL;
ALTER TABLE `tbltenant_plan_cancellation_actions` CHANGE `stripe_subscription_id` `stripe_subscription_id` VARCHAR(191) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL;

UPDATE tblplans SET apple_data = '{"group_id":"professional_subscription","yearly_product_apple_id":"1556829668","yearly_product_code":"professional_yearly_plan","yearly_product_price":"9.99","yearly_amount_saved":"$9.99\/mo. Save $47.99!","monthly_product_apple_id":"1556828308","monthly_product_code":"professional_monthly_plan","monthly_product_price":"13.99"}' WHERE codename = '7_pro';

UPDATE tblplans SET apple_data = '{"group_id":"corporate_subscription","yearly_product_apple_id":"1556843082","yearly_product_code":"corporate_yearly_plan","yearly_product_price":"28.99","yearly_amount_saved":"$28.99\/mo. Save $150.99!","monthly_product_apple_id":"1556842015","monthly_product_code":"corporate_monthly_plan","monthly_product_price":"48.99"}' WHERE codename = '7_pro_elite';

UPDATE tblplans SET apple_data = '{"group_id":"ultimate_subscription","yearly_product_apple_id":"1556989875","yearly_product_code":"ultimate_yearly_plan","yearly_product_price":"58.99","yearly_amount_saved":"$58.99\/mo. Save $479.99!","monthly_product_apple_id":"1556989809","monthly_product_code":"ultimate_monthly_plan","monthly_product_price":"98.99"}' WHERE codename = '7_pro_exclusive';