-- Migration: Add Paystack columns to subscriptions and plans tables
-- Run this SQL to update your database schema for Paystack integration

-- Add Paystack columns to subscriptions table
ALTER TABLE subscriptions 
ADD COLUMN IF NOT EXISTS payment_method ENUM('manual','paystack','stripe') DEFAULT 'manual' AFTER cancelled_at,
ADD COLUMN IF NOT EXISTS paystack_reference VARCHAR(100) NULL AFTER payment_method,
ADD COLUMN IF NOT EXISTS paystack_subscription_code VARCHAR(100) NULL AFTER paystack_reference,
ADD COLUMN IF NOT EXISTS paystack_customer_code VARCHAR(100) NULL AFTER paystack_subscription_code;

-- Add Paystack plan code column to plans table
ALTER TABLE plans 
ADD COLUMN IF NOT EXISTS paystack_plan_code VARCHAR(100) NULL AFTER features;
