ALTER TABLE `mail_lists` ADD IF NOT EXISTS `site_id` INT(11) unsigned NOT NULL AFTER `id`;
ALTER TABLE `sites` ADD IF NOT EXISTS `enable_retina` INT(11) NOT NULL DEFAULT 1 AFTER `facebook_app_secret`;
ALTER TABLE `sites` ADD IF NOT EXISTS `enable_html5` INT(11) NOT NULL DEFAULT 1 AFTER `enable_retina`;
ALTER TABLE `users` ADD IF NOT EXISTS `mailing_list_id` INT(11) unsigned NOT NULL DEFAULT 0 AFTER `media_admin`;
ALTER TABLE `users` ADD IF NOT EXISTS `active` TINYINT(1) UNSIGNED NOT NULL DEFAULT 1;

CREATE TABLE IF NOT EXISTS `testimonials` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `site_id` int(11) unsigned NOT NULL,
  `client_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `seo_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `snippet` tinyint(1) NOT NULL DEFAULT '0',
  `testimonial` text COLLATE utf8_unicode_ci NOT NULL,
  `published` tinyint(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`),
  KEY `snippet` (`snippet`),
  KEY `published` (`published`),
  KEY `site_id` (`site_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE IF NOT EXISTS `portfolio` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `site_id` int(11) unsigned NOT NULL,
  `title` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `client_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `seo_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `preview` text COLLATE utf8_unicode_ci NOT NULL,
  `description` text COLLATE utf8_unicode_ci NOT NULL,
  `year` int(4) NOT NULL,
  `tags` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `url` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `image_preview` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `image_full` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  `published` tinyint(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
