CREATE TABLE IF NOT EXISTS `categories` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `site_id` int(11) unsigned NOT NULL,
  `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1;

ALTER TABLE `pages` ADD IF NOT EXISTS `category_id` INT(11) unsigned NOT NULL AFTER `site_id`;
ALTER TABLE `pages` ADD IF NOT EXISTS `added` DATETIME NOT NULL AFTER `category_id`;
ALTER TABLE `pages` ADD IF NOT EXISTS `social` INT(11) NOT NULL AFTER `requires_login`;
