DO $$
BEGIN
  IF NOT EXISTS (
    SELECT 1
    FROM pg_type t
    INNER JOIN pg_enum e ON e.enumtypid = t.oid
    WHERE t.typname = 'wallet_owner_type_enum'
      AND e.enumlabel = 'ORGANIZATION'
  ) THEN
    ALTER TYPE wallet_owner_type_enum ADD VALUE 'ORGANIZATION';
  END IF;
END $$;
