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

CREATE TABLE IF NOT EXISTS `op_user` (
  `id` varchar(255) NOT NULL COMMENT 'User''s email address',
  `extra` text NOT NULL,
  UNIQUE KEY `owner` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

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

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

--
-- 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` 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,
  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)';

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

