ALTER TABLE  `plugin_imageviewer_meta` ADD  `date_taken` DATETIME NULL;

CREATE TABLE IF NOT EXISTS `plugin_imageviewer_category` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `label` varchar(255) COLLATE utf8_bin NOT NULL,
  `key` varchar(255) COLLATE utf8_bin NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `key` (`key`),
  KEY `label` (`label`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=15 ;

INSERT INTO `plugin_imageviewer_category` (`id`, `label`, `key`) VALUES
(1, 'Just For Fun', 'just-for-fun'),
(2, 'Scenes', 'scenes'),
(3, 'Work', 'work'),
(4, 'Sports', 'sports'),
(5, 'Music', 'music'),
(6, 'Colorful', 'colorful'),
(7, 'Nature', 'nature'),
(8, 'Travel', 'travel'),
(9, 'Weddings', 'weddings'),
(10, 'Animals', 'animals'),
(11, 'Illustrations', 'illustrations'),
(12, 'Cars', 'cars'),
(13, 'Art', 'art'),
(14, 'Other', 'other');

CREATE TABLE IF NOT EXISTS `plugin_imageviewer_category_file` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `file_id` int(11) NOT NULL,
  `category_id` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `file_id` (`file_id`,`category_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=1;

CREATE TABLE  `plugin_imageviewer_image_like` (
`id` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`file_id` INT( 11 ) NOT NULL ,
`user_id` INT( 11 ) NOT NULL ,
`created` DATETIME NOT NULL ,
INDEX (  `file_id` ,  `user_id` ,  `created` )
) ENGINE = MYISAM ;
