-- ============================================================
-- Migration 009: MooChedda Token Minting for Loyalty Programs
-- ============================================================

ALTER TABLE loyalty_programs
  ADD COLUMN IF NOT EXISTS moochedda_token_symbol VARCHAR(50) AFTER external_id,
  ADD COLUMN IF NOT EXISTS moochedda_token_name VARCHAR(255) AFTER moochedda_token_symbol,
  ADD COLUMN IF NOT EXISTS moochedda_token_supply BIGINT DEFAULT 0 AFTER moochedda_token_name,
  ADD COLUMN IF NOT EXISTS moochedda_token_id VARCHAR(255) AFTER moochedda_token_supply,
  ADD COLUMN IF NOT EXISTS moochedda_token_created_at DATETIME AFTER moochedda_token_id;

-- Allow loyalty_customers to store the customer's MooChedda wallet address
ALTER TABLE loyalty_customers
  ADD COLUMN IF NOT EXISTS moochedda_address VARCHAR(200) AFTER referred_by;
