-- Fix API system migration - correct column references
-- This fixes the error in 001_api_system.sql where wrong column name was referenced

USE whp;

-- Add API permissions to existing client_allowances table with correct column reference
ALTER TABLE client_allowances 
ADD COLUMN IF NOT EXISTS api_enabled BOOLEAN DEFAULT FALSE AFTER max_email_accounts,
ADD COLUMN IF NOT EXISTS api_rate_limit INT DEFAULT 100 AFTER api_enabled;