 --
 
 CREATE TABLE IF NOT EXISTS `op_groupMember` (
-  `id` varchar(6) NOT NULL,
-  `owner` varchar(255) NOT NULL,
-  `group` varchar(255) NOT NULL,
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `owner` varchar(255) NOT NULL,
+  `group` varchar(6) 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;
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `owner` (`owner`,`group`,`email`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
 
 -- --------------------------------------------------------
 

--

CREATE TABLE IF NOT EXISTS `op_credential` (
  `id` varchar(6) NOT NULL,
  `owner` varchar(255) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `image` text,

  `size` int(11) DEFAULT NULL,
  `width` int(11) DEFAULT NULL,
  `height` int(11) DEFAULT NULL,
  `extra` text,
  `exif` text,
  `views` int(11) DEFAULT NULL,
  `status` int(11) DEFAULT NULL,
  `permission` int(11) DEFAULT NULL,
