-- Add admin transaction types to the credit_transactions constraint
ALTER TABLE credit_transactions 
DROP CONSTRAINT IF EXISTS credit_transactions_transaction_type_check;

ALTER TABLE credit_transactions 
ADD CONSTRAINT credit_transactions_transaction_type_check 
CHECK (transaction_type = ANY (ARRAY[
  'credit_purchase'::text, 
  'lead_purchase'::text, 
  'refund'::text,
  'admin_credit'::text,
  'admin_debit'::text
]));