 -- Load the brands into our table
 INSERT IGNORE INTO brand (name, slug)
   SELECT brand_name,
-         REPLACE(REPLACE(LOWER(brand_name), '&', 'and'), ' ', '-') slug
+         slug(brand_name) slug
     FROM mac_item_brands ORDER BY brand_name;
 
 -- And link them back to the mac_item_brands info

         WHERE mac_item_brands.item_no = mac_catalog.item_no) brand,
       product_title,
       description,
       REPLACE(REPLACE(LOWER(product_title), '&', 'and'), ' ', '-') slug,
       large_480,
       item_no
  FROM mac_catalog

TRUNCATE department;
INSERT INTO department (name, slug, pos)
SELECT DISTINCT chapter,
                slug(chapter),
                0
  FROM mac_catalog
 WHERE category != '';
