text: #
  # TABLE STRUCTURE FOR: admin_groups
  #
  
  DROP TABLE IF EXISTS `admin_groups`;
  
  CREATE TABLE `admin_groups` (
    `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
    `name` varchar(20) NOT NULL,
    `description` varchar(100) NOT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
  
  INSERT INTO `admin_groups` (`id`, `name`, `description`) VALUES ('1', 'webmaster', 'Webmaster');
  INSERT INTO `admin_groups` (`id`, `name`, `description`) VALUES ('2', 'admin', 'Administrator');
  INSERT INTO `admin_groups` (`id`, `name`, `description`) VALUES ('3', 'manager', 'Manager');
  INSERT INTO `admin_groups` (`id`, `name`, `description`) VALUES ('4', 'staff', 'Staff');
  
  
  #
  # TABLE STRUCTURE FOR: admin_login_attempts
  #
  
  DROP TABLE IF EXISTS `admin_login_attempts`;
  
  CREATE TABLE `admin_login_attempts` (
    `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
    `ip_address` varchar(15) NOT NULL,
    `login` varchar(100) NOT NULL,
    `time` int(11) unsigned DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  #
  # TABLE STRUCTURE FOR: admin_users
  #
  
  DROP TABLE IF EXISTS `admin_users`;
  
  CREATE TABLE `admin_users` (
    `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
    `ip_address` varchar(15) NOT NULL,
    `username` varchar(100) DEFAULT NULL,
    `password` varchar(255) NOT NULL,
    `salt` varchar(255) DEFAULT NULL,
    `email` varchar(100) DEFAULT NULL,
    `activation_code` varchar(40) DEFAULT NULL,
    `forgotten_password_code` varchar(40) DEFAULT NULL,
    `forgotten_password_time` int(11) unsigned DEFAULT NULL,
    `remember_code` varchar(40) DEFAULT NULL,
    `created_on` int(11) unsigned NOT NULL,
    `last_login` int(11) unsigned DEFAULT NULL,
    `active` tinyint(1) unsigned DEFAULT NULL,
    `first_name` varchar(50) DEFAULT NULL,
    `last_name` varchar(50) DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
  
  INSERT INTO `admin_users` (`id`, `ip_address`, `username`, `password`, `salt`, `email`, `activation_code`, `forgotten_password_code`, `forgotten_password_time`, `remember_code`, `created_on`, `last_login`, `active`, `first_name`, `last_name`) VALUES ('1', '127.0.0.1', 'webmaster', '$2y$08$/X5gzWjesYi78GqeAv5tA.dVGBVP7C1e1PzqnYCVe5s1qhlDIPPES', NULL, NULL, NULL, NULL, NULL, NULL, '1451900190', '1495436556', '1', 'Webmaster', '');
  INSERT INTO `admin_users` (`id`, `ip_address`, `username`, `password`, `salt`, `email`, `activation_code`, `forgotten_password_code`, `forgotten_password_time`, `remember_code`, `created_on`, `last_login`, `active`, `first_name`, `last_name`) VALUES ('2', '127.0.0.1', 'admin', '$2y$08$7Bkco6JXtC3Hu6g9ngLZDuHsFLvT7cyAxiz1FzxlX5vwccvRT7nKW', NULL, NULL, NULL, NULL, NULL, NULL, '1451900228', '1494426244', '1', 'Admin', '');
  INSERT INTO `admin_users` (`id`, `ip_address`, `username`, `password`, `salt`, `email`, `activation_code`, `forgotten_password_code`, `forgotten_password_time`, `remember_code`, `created_on`, `last_login`, `active`, `first_name`, `last_name`) VALUES ('3', '127.0.0.1', 'manager', '$2y$08$snzIJdFXvg/rSHe0SndIAuvZyjktkjUxBXkrrGdkPy1K6r5r/dMLa', NULL, NULL, NULL, NULL, NULL, NULL, '1451900430', '1494595172', '1', 'Manager', '');
  INSERT INTO `admin_users` (`id`, `ip_address`, `username`, `password`, `salt`, `email`, `activation_code`, `forgotten_password_code`, `forgotten_password_time`, `remember_code`, `created_on`, `last_login`, `active`, `first_name`, `last_name`) VALUES ('4', '127.0.0.1', 'staff', '$2y$08$NigAXjN23CRKllqe3KmjYuWXD5iSRPY812SijlhGeKfkrMKde9da6', NULL, NULL, NULL, NULL, NULL, NULL, '1451900439', '1465489590', '1', 'Staff', NULL);
  
  
  #
  # TABLE STRUCTURE FOR: admin_users_groups
  #
  
  DROP TABLE IF EXISTS `admin_users_groups`;
  
  CREATE TABLE `admin_users_groups` (
    `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
    `user_id` int(11) unsigned NOT NULL,
    `group_id` mediumint(8) unsigned NOT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
  
  INSERT INTO `admin_users_groups` (`id`, `user_id`, `group_id`) VALUES ('1', '1', '1');
  INSERT INTO `admin_users_groups` (`id`, `user_id`, `group_id`) VALUES ('2', '2', '2');
  INSERT INTO `admin_users_groups` (`id`, `user_id`, `group_id`) VALUES ('3', '3', '3');
  INSERT INTO `admin_users_groups` (`id`, `user_id`, `group_id`) VALUES ('4', '4', '4');
  
  
  #
  # TABLE STRUCTURE FOR: api_access
  #
  
  DROP TABLE IF EXISTS `api_access`;
  
  CREATE TABLE `api_access` (
    `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
    `key` varchar(40) NOT NULL DEFAULT '',
    `controller` varchar(50) NOT NULL DEFAULT '',
    `date_created` datetime DEFAULT NULL,
    `date_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  #
  # TABLE STRUCTURE FOR: api_keys
  #
  
  DROP TABLE IF EXISTS `api_keys`;
  
  CREATE TABLE `api_keys` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `user_id` int(11) NOT NULL,
    `key` varchar(40) NOT NULL,
    `level` int(2) NOT NULL,
    `ignore_limits` tinyint(1) NOT NULL DEFAULT '0',
    `is_private_key` tinyint(1) NOT NULL DEFAULT '0',
    `ip_addresses` text,
    `date_created` int(11) NOT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
  
  INSERT INTO `api_keys` (`id`, `user_id`, `key`, `level`, `ignore_limits`, `is_private_key`, `ip_addresses`, `date_created`) VALUES ('1', '0', 'anonymous', '1', '1', '0', NULL, '1463388382');
  
  
  #
  # TABLE STRUCTURE FOR: api_limits
  #
  
  DROP TABLE IF EXISTS `api_limits`;
  
  CREATE TABLE `api_limits` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `uri` varchar(255) NOT NULL,
    `count` int(10) NOT NULL,
    `hour_started` int(11) NOT NULL,
    `api_key` varchar(40) NOT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  #
  # TABLE STRUCTURE FOR: api_logs
  #
  
  DROP TABLE IF EXISTS `api_logs`;
  
  CREATE TABLE `api_logs` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `uri` varchar(255) NOT NULL,
    `method` varchar(6) NOT NULL,
    `params` text,
    `api_key` varchar(40) NOT NULL,
    `ip_address` varchar(45) NOT NULL,
    `time` int(11) NOT NULL,
    `rtime` float DEFAULT NULL,
    `authorized` varchar(1) NOT NULL,
    `response_code` smallint(3) DEFAULT '0',
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  #
  # TABLE STRUCTURE FOR: blog_categories
  #
  
  DROP TABLE IF EXISTS `blog_categories`;
  
  CREATE TABLE `blog_categories` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `pos` int(11) NOT NULL DEFAULT '0',
    `title` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
  
  INSERT INTO `blog_categories` (`id`, `pos`, `title`) VALUES ('1', '1', 'Category 1');
  INSERT INTO `blog_categories` (`id`, `pos`, `title`) VALUES ('2', '2', 'Category 2');
  INSERT INTO `blog_categories` (`id`, `pos`, `title`) VALUES ('3', '3', 'Category 3');
  
  
  #
  # TABLE STRUCTURE FOR: blog_posts
  #
  
  DROP TABLE IF EXISTS `blog_posts`;
  
  CREATE TABLE `blog_posts` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `category_id` int(11) NOT NULL DEFAULT '1',
    `author_id` int(11) NOT NULL,
    `title` varchar(300) COLLATE utf8_unicode_ci NOT NULL,
    `image_url` varchar(300) COLLATE utf8_unicode_ci NOT NULL,
    `content_brief` text COLLATE utf8_unicode_ci NOT NULL,
    `content` text COLLATE utf8_unicode_ci NOT NULL,
    `publish_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `status` enum('draft','active','hidden') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'draft',
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
  
  INSERT INTO `blog_posts` (`id`, `category_id`, `author_id`, `title`, `image_url`, `content_brief`, `content`, `publish_time`, `status`) VALUES ('1', '1', '2', 'Blog Post 1', '', '<p>\r\n	Blog Post 1 Content Brief</p>\r\n', '<p>\r\n	Blog Post 1 Content</p>\r\n', '2015-09-26 00:00:00', 'active');
  INSERT INTO `blog_posts` (`id`, `category_id`, `author_id`, `title`, `image_url`, `content_brief`, `content`, `publish_time`, `status`) VALUES ('3', '2', '1', 'test blog 2', '', '<p>testing</p>\r\n', '<p>testing</p>\r\n', '0000-00-00 00:00:00', 'draft');
  
  
  #
  # TABLE STRUCTURE FOR: blog_posts_tags
  #
  
  DROP TABLE IF EXISTS `blog_posts_tags`;
  
  CREATE TABLE `blog_posts_tags` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `post_id` int(11) NOT NULL,
    `tag_id` int(11) NOT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
  
  INSERT INTO `blog_posts_tags` (`id`, `post_id`, `tag_id`) VALUES ('1', '1', '2');
  INSERT INTO `blog_posts_tags` (`id`, `post_id`, `tag_id`) VALUES ('2', '1', '1');
  INSERT INTO `blog_posts_tags` (`id`, `post_id`, `tag_id`) VALUES ('3', '1', '3');
  INSERT INTO `blog_posts_tags` (`id`, `post_id`, `tag_id`) VALUES ('5', '3', '2');
  
  
  #
  # TABLE STRUCTURE FOR: blog_tags
  #
  
  DROP TABLE IF EXISTS `blog_tags`;
  
  CREATE TABLE `blog_tags` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `title` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
  
  INSERT INTO `blog_tags` (`id`, `title`) VALUES ('1', 'Tag 1');
  INSERT INTO `blog_tags` (`id`, `title`) VALUES ('2', 'Tag 2');
  INSERT INTO `blog_tags` (`id`, `title`) VALUES ('3', 'Tag 3');
  
  
  #
  # TABLE STRUCTURE FOR: cover_photos
  #
  
  DROP TABLE IF EXISTS `cover_photos`;
  
  CREATE TABLE `cover_photos` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `pos` int(11) NOT NULL DEFAULT '0',
    `image_url` varchar(300) COLLATE utf8_unicode_ci NOT NULL,
    `status` enum('active','hidden') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'active',
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
  
  INSERT INTO `cover_photos` (`id`, `pos`, `image_url`, `status`) VALUES ('1', '2', '45296-2.jpg', 'active');
  INSERT INTO `cover_photos` (`id`, `pos`, `image_url`, `status`) VALUES ('2', '3', '2934f-1.jpg', 'active');
  INSERT INTO `cover_photos` (`id`, `pos`, `image_url`, `status`) VALUES ('3', '1', '3717d-3.jpg', 'active');
  
  
  #
  # TABLE STRUCTURE FOR: groups
  #
  
  DROP TABLE IF EXISTS `groups`;
  
  CREATE TABLE `groups` (
    `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
    `name` varchar(20) NOT NULL,
    `description` varchar(100) NOT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
  
  INSERT INTO `groups` (`id`, `name`, `description`) VALUES ('1', 'members', 'General User');
  
  
  #
  # TABLE STRUCTURE FOR: login_attempts
  #
  
  DROP TABLE IF EXISTS `login_attempts`;
  
  CREATE TABLE `login_attempts` (
    `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
    `ip_address` varchar(15) NOT NULL,
    `login` varchar(100) NOT NULL,
    `time` int(11) unsigned DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  
  #
  # TABLE STRUCTURE FOR: products
  #
  
  DROP TABLE IF EXISTS `products`;
  
  CREATE TABLE `products` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `category_id` int(11) NOT NULL,
    `name` varchar(255) NOT NULL,
    `image_url` varchar(255) NOT NULL,
    `price` double NOT NULL,
    `description` text NOT NULL,
    `status` tinyint(1) NOT NULL DEFAULT '1',
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
  
  INSERT INTO `products` (`id`, `category_id`, `name`, `image_url`, `price`, `description`, `status`) VALUES ('1', '1', 'Test product', '60850-home-icon.png', '24.99', '<p>This is my first test product.</p>\r\n', '1');
  
  
  #
  # TABLE STRUCTURE FOR: products_categories
  #
  
  DROP TABLE IF EXISTS `products_categories`;
  
  CREATE TABLE `products_categories` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `pos` int(11) NOT NULL,
    `title` varchar(255) NOT NULL,
    PRIMARY KEY (`id`),
    UNIQUE KEY `id` (`id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
  
  INSERT INTO `products_categories` (`id`, `pos`, `title`) VALUES ('1', '0', 'Product category 1');
  INSERT INTO `products_categories` (`id`, `pos`, `title`) VALUES ('2', '0', 'Product category 2');
  
  
  #
  # TABLE STRUCTURE FOR: products_tags
  #
  
  DROP TABLE IF EXISTS `products_tags`;
  
  CREATE TABLE `products_tags` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `title` varchar(255) NOT NULL,
    PRIMARY KEY (`id`),
    UNIQUE KEY `id` (`id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1;
  
  INSERT INTO `products_tags` (`id`, `title`) VALUES ('1', 'Business');
  INSERT INTO `products_tags` (`id`, `title`) VALUES ('2', 'Outdoor');
  INSERT INTO `products_tags` (`id`, `title`) VALUES ('3', 'Indoor');
  INSERT INTO `products_tags` (`id`, `title`) VALUES ('4', 'Games');
  INSERT INTO `products_tags` (`id`, `title`) VALUES ('5', 'Health');
  INSERT INTO `products_tags` (`id`, `title`) VALUES ('6', 'Electronics');
  
  
  #
  # TABLE STRUCTURE FOR: products_tags_link
  #
  
  DROP TABLE IF EXISTS `products_tags_link`;
  
  CREATE TABLE `products_tags_link` (
    `id` int(11) NOT NULL,
    `products_id` int(11) NOT NULL,
    `tag_id` int(11) NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  
  INSERT INTO `products_tags_link` (`id`, `products_id`, `tag_id`) VALUES ('0', '1', '1');
  
  
  #
  # TABLE STRUCTURE FOR: users
  #
  
  DROP TABLE IF EXISTS `users`;
  
  CREATE TABLE `users` (
    `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
    `ip_address` varchar(15) NOT NULL,
    `username` varchar(100) DEFAULT NULL,
    `password` varchar(255) NOT NULL,
    `salt` varchar(255) DEFAULT NULL,
    `email` varchar(100) NOT NULL,
    `activation_code` varchar(40) DEFAULT NULL,
    `forgotten_password_code` varchar(40) DEFAULT NULL,
    `forgotten_password_time` int(11) unsigned DEFAULT NULL,
    `remember_code` varchar(40) DEFAULT NULL,
    `created_on` int(11) unsigned NOT NULL,
    `last_login` int(11) unsigned DEFAULT NULL,
    `active` tinyint(1) unsigned DEFAULT NULL,
    `first_name` varchar(50) DEFAULT NULL,
    `last_name` varchar(50) DEFAULT NULL,
    `company` varchar(100) DEFAULT NULL,
    `phone` varchar(20) DEFAULT NULL,
    `about` text,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
  
  INSERT INTO `users` (`id`, `ip_address`, `username`, `password`, `salt`, `email`, `activation_code`, `forgotten_password_code`, `forgotten_password_time`, `remember_code`, `created_on`, `last_login`, `active`, `first_name`, `last_name`, `company`, `phone`, `about`) VALUES ('1', '127.0.0.1', 'member', '$2y$08$0Ygj1nHShNKMZcB./zUfxOyDc3lHNg.rpVW0N1J9lfE0Lyy/zIX9u', NULL, 'member@member.com', NULL, NULL, NULL, NULL, '1451903855', '1451905011', '1', 'Member', 'One', NULL, NULL, NULL);
  
  
  #
  # TABLE STRUCTURE FOR: users_groups
  #
  
  DROP TABLE IF EXISTS `users_groups`;
  
  CREATE TABLE `users_groups` (
    `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
    `user_id` int(11) unsigned NOT NULL,
    `group_id` mediumint(8) unsigned NOT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
  
  INSERT INTO `users_groups` (`id`, `user_id`, `group_id`) VALUES ('1', '1', '1');
  
  
  