-- Table structure for `user_comment`
-- ----------------------------
CREATE TABLE `user_comment` (
  `ucid` int(11) NOT NULL AUTO_INCREMENT,
  `uid` int(11) NOT NULL,
  `pid` int(11) NOT NULL DEFAULT '0',
  `annotator_uid` int(11) NOT NULL,
  `ano_username` varchar(255) DEFAULT NULL,
  `text` text NOT NULL,
  `status` int(11) NOT NULL DEFAULT '0',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`ucid`),
  KEY `uc_i_uid` (`uid`),
  KEY `uc_i_pid` (`pid`),
  KEY `uc_i_annotator_uid` (`annotator_uid`),
  CONSTRAINT `uc_fk_annotator_uid` FOREIGN KEY (`annotator_uid`) REFERENCES `user` (`uid`),
  CONSTRAINT `uc_fk_uid` FOREIGN KEY (`uid`) REFERENCES `user` (`uid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- ----------------------------
-- Records of user_comment
-- ----------------------------

-- ----------------------------
-- Table structure for `user_facebook`
-- ----------------------------
CREATE TABLE `user_facebook` (
  `fbuid` varchar(255) NOT NULL,
  `uid` int(11) NOT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`fbuid`),
  KEY `ufb_i_fbuid` (`fbuid`),
  KEY `ufb_i_uid` (`uid`),
  CONSTRAINT `ufb_fk_uid` FOREIGN KEY (`uid`) REFERENCES `user` (`uid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- ----------------------------
-- Records of user_facebook
-- ----------------------------

-- ----------------------------
-- Table structure for `user_field`
-- ----------------------------
CREATE TABLE `user_field` (
  `ufid` int(11) NOT NULL AUTO_INCREMENT,
  `fieldtype` int(11) NOT NULL,
  `fieldname` varchar(255) NOT NULL,
  `required` tinyint(1) NOT NULL DEFAULT '0',
  `defaultvalue` varchar(255) DEFAULT NULL,
  `maxlength` int(11) DEFAULT NULL,
  `min` varchar(255) DEFAULT NULL,
  `max` varchar(255) DEFAULT NULL,
  `weight` int(11) NOT NULL DEFAULT '0',
  `status` int(11) NOT NULL DEFAULT '0',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`ufid`),
  KEY `ufi_i_ufid` (`ufid`),
  KEY `ufi_i_fieldtype` (`fieldtype`),
  KEY `ufi_i_fieldname` (`fieldname`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=latin1;

-- ----------------------------
-- Records of user_field
-- ----------------------------
INSERT INTO `user_field` VALUES ('1', '0', 'firstname', '0', null, '20', null, null, '1', '3', '2015-05-29 10:02:12', '2015-05-29 10:02:12');
INSERT INTO `user_field` VALUES ('2', '0', 'lastname', '0', null, '20', null, null, '2', '3', '2015-05-29 10:02:12', '2015-05-29 10:02:12');
INSERT INTO `user_field` VALUES ('3', '0', 'city', '0', null, '150', null, null, '3', '3', '2015-05-29 10:02:12', '2015-05-29 10:02:12');
INSERT INTO `user_field` VALUES ('4', '5', 'country', '0', null, null, null, null, '4', '3', '2015-05-29 10:02:12', '2015-05-29 10:02:12');
INSERT INTO `user_field` VALUES ('5', '3', 'birthday', '0', null, null, null, '[now]', '5', '3', '2015-05-29 10:02:12', '2015-05-29 10:02:12');
INSERT INTO `user_field` VALUES ('6', '4', 'gender', '0', null, null, null, null, '6', '3', '2015-05-29 10:02:12', '2015-05-29 10:02:12');
INSERT INTO `user_field` VALUES ('7', '2', 'about', '0', null, null, null, null, '7', '3', '2015-05-29 10:02:12', '2015-05-29 10:02:12');

-- ----------------------------
-- Table structure for `user_field_i18n`
-- ----------------------------
CREATE TABLE `user_field_i18n` (
  `ufid` int(11) NOT NULL,
  `culture` varchar(7) NOT NULL,
  `name` varchar(255) NOT NULL,
  `description` text,
  PRIMARY KEY (`ufid`,`culture`),
  KEY `ufii_i_ufid` (`ufid`),
  KEY `ufii_i_culture` (`culture`),
  CONSTRAINT `ufii_fk_ufid` FOREIGN KEY (`ufid`) REFERENCES `user_field` (`ufid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- ----------------------------
-- Records of user_field_i18n
-- ----------------------------
INSERT INTO `user_field_i18n` VALUES ('1', 'de', 'Vorname', null);
INSERT INTO `user_field_i18n` VALUES ('1', 'en', 'First name', null);
INSERT INTO `user_field_i18n` VALUES ('2', 'de', 'Nachname', null);
INSERT INTO `user_field_i18n` VALUES ('2', 'en', 'Last name', null);
INSERT INTO `user_field_i18n` VALUES ('3', 'de', 'Stadt', null);
INSERT INTO `user_field_i18n` VALUES ('3', 'en', 'City', null);
INSERT INTO `user_field_i18n` VALUES ('4', 'de', 'Land', null);
INSERT INTO `user_field_i18n` VALUES ('4', 'en', 'Country', null);
INSERT INTO `user_field_i18n` VALUES ('5', 'de', 'Geburtstag', null);
INSERT INTO `user_field_i18n` VALUES ('5', 'en', 'Birthday', null);
INSERT INTO `user_field_i18n` VALUES ('6', 'de', 'Geschlecht', null);
INSERT INTO `user_field_i18n` VALUES ('6', 'en', 'Gender', null);
INSERT INTO `user_field_i18n` VALUES ('7', 'de', 'Über mich', null);
INSERT INTO `user_field_i18n` VALUES ('7', 'en', 'About me', null);

-- ----------------------------
-- Table structure for `user_field_option`
-- ----------------------------
CREATE TABLE `user_field_option` (
  `ufoid` int(11) NOT NULL AUTO_INCREMENT,
  `ufid` int(11) NOT NULL,
  `value` varchar(255) NOT NULL,
  `weight` int(11) NOT NULL DEFAULT '0',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`ufoid`),
  KEY `ufo_i_ufid` (`ufid`),
  KEY `ufo_i_value` (`value`),
  CONSTRAINT `ufo_fk_ufid` FOREIGN KEY (`ufid`) REFERENCES `user_field` (`ufid`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;

-- ----------------------------
-- Records of user_field_option
-- ----------------------------
INSERT INTO `user_field_option` VALUES ('1', '6', 'male', '1', '2015-05-29 10:02:12', '2015-05-29 10:02:12');
INSERT INTO `user_field_option` VALUES ('2', '6', 'female', '2', '2015-05-29 10:02:12', '2015-05-29 10:02:12');

-- ----------------------------
-- Table structure for `user_field_option_i18n`
-- ----------------------------
CREATE TABLE `user_field_option_i18n` (
  `ufoid` int(11) NOT NULL,
  `culture` varchar(7) NOT NULL,
  `name` varchar(255) NOT NULL,
  PRIMARY KEY (`ufoid`,`culture`),
  KEY `ufoi_i_ufoid` (`ufoid`),
  KEY `ufoi_i_culture` (`culture`),
  CONSTRAINT `ufoi_fk_ufoid` FOREIGN KEY (`ufoid`) REFERENCES `user_field_option` (`ufoid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- ----------------------------
-- Records of user_field_option_i18n
-- ----------------------------
INSERT INTO `user_field_option_i18n` VALUES ('1', 'de', 'männlich');
INSERT INTO `user_field_option_i18n` VALUES ('1', 'en', 'male');
INSERT INTO `user_field_option_i18n` VALUES ('2', 'de', 'weiblich');
INSERT INTO `user_field_option_i18n` VALUES ('2', 'en', 'female');

-- ----------------------------
-- Table structure for `user_field_value`
-- ----------------------------
CREATE TABLE `user_field_value` (
  `uid` int(11) NOT NULL,
  `ufid` int(11) NOT NULL,
  `value` text,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`uid`,`ufid`),
  KEY `ufv_i_ufid` (`ufid`),
  KEY `ufv_i_uid` (`uid`),
  CONSTRAINT `ufv_fk_ufid` FOREIGN KEY (`ufid`) REFERENCES `user_field` (`ufid`),
  CONSTRAINT `ufv_fk_uid` FOREIGN KEY (`uid`) REFERENCES `user` (`uid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- ----------------------------
-- Records of user_field_value
-- ----------------------------

-- ----------------------------
-- Table structure for `user_flag`
-- ----------------------------
CREATE TABLE `user_flag` (
  `flagid` int(11) NOT NULL AUTO_INCREMENT,
  `uid` int(11) NOT NULL,
  `flagged_uid` int(11) NOT NULL,
  `reason` text NOT NULL,
  `status` int(11) NOT NULL DEFAULT '0',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`flagid`),
  KEY `ufl_i_uid` (`uid`),
  KEY `ufl_i_flagged_uid` (`flagged_uid`),
  KEY `ufl_i_status` (`status`),
  CONSTRAINT `ufl_fk_flagged_uid` FOREIGN KEY (`flagged_uid`) REFERENCES `user` (`uid`),
  CONSTRAINT `ufl_fk_uid` FOREIGN KEY (`uid`) REFERENCES `user` (`uid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- ----------------------------
-- Records of user_flag
-- ----------------------------

-- ----------------------------
-- Table structure for `user_friend`
-- ----------------------------
CREATE TABLE `user_friend` (
  `fid` int(11) NOT NULL AUTO_INCREMENT,
  `uid` int(11) NOT NULL,
  `friend_uid` int(11) NOT NULL,
  `status` int(11) NOT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`fid`),
  KEY `uf_i_uid` (`uid`),
  KEY `uf_i_friend_uid` (`friend_uid`),
  CONSTRAINT `uf_fk_friend_uid` FOREIGN KEY (`friend_uid`) REFERENCES `user` (`uid`),
  CONSTRAINT `uf_fk_uid` FOREIGN KEY (`uid`) REFERENCES `user` (`uid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- ----------------------------
-- Records of user_friend
-- ----------------------------

-- ----------------------------
-- Table structure for `user_role`
-- ----------------------------
CREATE TABLE `user_role` (
  `uid` int(11) NOT NULL,
  `rid` int(11) NOT NULL,
  PRIMARY KEY (`uid`,`rid`),
  KEY `ur_i_uid` (`uid`),
  KEY `ur_i_rid` (`rid`),
  CONSTRAINT `ur_fk_rid` FOREIGN KEY (`rid`) REFERENCES `role` (`rid`),
  CONSTRAINT `ur_fk_uid` FOREIGN KEY (`uid`) REFERENCES `user` (`uid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- ----------------------------
-- Records of user_role
-- ----------------------------
INSERT INTO `user_role` VALUES ('0', '0');
INSERT INTO `user_role` VALUES ('1', '1');
INSERT INTO `user_role` VALUES ('2', '2');
INSERT INTO `user_role` VALUES ('3', '3');

-- ----------------------------
-- Table structure for `video_sync`
-- ----------------------------
CREATE TABLE `video_sync` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `mid` int(10) DEFAULT NULL,
  `type` varchar(50) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- ----------------------------
-- Records of video_sync
-- ----------------------------

-- ----------------------------
-- Table structure for `watchdog`
-- ----------------------------
CREATE TABLE `watchdog` (
  `wid` int(11) NOT NULL AUTO_INCREMENT,
  `uid` int(11) NOT NULL,
  `type` varchar(20) NOT NULL,
  `severity` int(3) NOT NULL DEFAULT '0',
  `message` longtext NOT NULL,
  `hostname` varchar(244) NOT NULL,
  `referer` varchar(1024) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  PRIMARY KEY (`wid`,`type`),
  KEY `w_i_wid` (`wid`),
  KEY `w_i_uid` (`uid`),
  KEY `w_i_type` (`type`),
  CONSTRAINT `w_fk_uid` FOREIGN KEY (`uid`) REFERENCES `user` (`uid`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1;

-- ----------------------------
-- Records of watchdog
-- ----------------------------
INSERT INTO `watchdog` VALUES ('1', '1', 'syslog', '0', '[encoded data, 44912 characters]', '127.0.0.1', null, '2015-06-15 08:28:28');
INSERT INTO `watchdog` VALUES ('2', '1', 'syslog', '0', '[encoded data, 44912 characters]', '127.0.0.1', null, '2015-06-15 08:29:41');
INSERT INTO `watchdog` VALUES ('3', '1', 'syslog', '0', '[encoded data, 44912 characters]', '127.0.0.1', null, '2015-06-15 14:28:03');
INSERT INTO `watchdog` VALUES ('4', '1', 'syslog', '0', '[encoded data, 44912 characters]', '127.0.0.1', null, '2015-06-15 14:29:05');
INSERT INTO `watchdog` VALUES ('5', '1', 'syslog', '0', '[encoded data, 44916 characters]', '127.0.0.1', null, '2015-06-15 14:48:09');
INSERT INTO `watchdog` VALUES ('6', '0', 'syslog', '0', '[encoded data, 13372 characters]', '127.0.0.1', null, '2015-06-15 21:38:57');
INSERT INTO `watchdog` VALUES ('7', '1', 'syslog', '0', '[encoded data, 44912 characters]', '127.0.0.1', null, '2015-06-15 21:40:39');
INSERT INTO `watchdog` VALUES ('8', '1', 'syslog', '0', '[encoded data, 44912 characters]', '127.0.0.1', null, '2015-06-24 17:06:17');
INSERT INTO `watchdog` VALUES ('9', '1', 'syslog', '0', '[encoded data, 44912 characters]', '127.0.0.1', null, '2015-06-24 17:07:07');

-- ----------------------------
-- Table structure for `webcontent`
-- ----------------------------
CREATE TABLE `webcontent` (
  `wid` int(11) NOT NULL,
  `culture` varchar(7) NOT NULL,
  `sid` int(11) NOT NULL,
  `type` int(11) NOT NULL,
  `status` int(11) NOT NULL DEFAULT '0',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`wid`,`culture`),
  KEY `wc_i_sid` (`sid`),
  CONSTRAINT `wc_fk_sid` FOREIGN KEY (`sid`) REFERENCES `statictext` (`sid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- ----------------------------
-- Records of webcontent
-- ----------------------------
