CREATE TABLE `redirects` (
  `redirect_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `site_id` int(11) unsigned NOT NULL,
  `old_url` varchar(255) NOT NULL DEFAULT '',
  `new_url` varchar(255) DEFAULT NULL,
  `page_id` int(11) unsigned DEFAULT NULL,
  PRIMARY KEY (`redirect_id`),
  KEY `page_id` (`page_id`),
  KEY `site_id` (`site_id`),
  KEY `old_url` (`old_url`),
  CONSTRAINT `redirects_ibfk_1` FOREIGN KEY (`page_id`) REFERENCES `pages` (`page_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `redirects_ibfk_2` FOREIGN KEY (`site_id`) REFERENCES `sites` (`site_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
