 -- --------------------------------------------------------
 
 --
+-- Table structure for table `op_elementGroup`
+--
+
+CREATE TABLE IF NOT EXISTS `op_elementGroup` (
+  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+  `owner` varchar(255) NOT NULL,
+  `type` enum('photo') NOT NULL,
+  `element` varchar(6) NOT NULL,
+  `group` varchar(6) NOT NULL,
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `owner` (`owner`,`type`,`element`,`group`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
 -- Table structure for table `op_elementTag`
 --
 
 CREATE TABLE IF NOT EXISTS `op_elementTag` (
-  `id` varchar(6) NOT NULL,
+  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
+  `owner` varchar(255) NOT NULL,
   `type` enum('photo') NOT NULL,
   `element` varchar(6) NOT NULL DEFAULT 'photo',
   `tag` varchar(255) NOT NULL,
-  UNIQUE KEY `id` (`id`,`type`,`element`,`tag`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Tag mapping table for photos (and videos in the future)';
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `id` (`owner`,`type`,`element`,`tag`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='Tag mapping table for photos (and videos in the future)';
 
 -- --------------------------------------------------------
 

--

CREATE TABLE IF NOT EXISTS `op_groupMember` (
  `id` varchar(6) NOT NULL,
  `owner` varchar(255) NOT NULL,
  `group` varchar(255) NOT NULL,
  `email` varchar(255) NOT NULL,
  `permission` tinyint(3) unsigned NOT NULL COMMENT 'bitmask of permissions',
  UNIQUE KEY `id` (`id`,`owner`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------


  `pathOriginal` varchar(1000) DEFAULT NULL,
  `pathBase` varchar(1000) DEFAULT NULL,
  `tags` varchar(1000) DEFAULT NULL,
  `groups` varchar(1000) DEFAULT NULL,
  UNIQUE KEY `id` (`id`,`owner`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

