# ************************************************************
# Sequel Pro SQL dump
# Version 4096
#
# http://www.sequelpro.com/
# http://code.google.com/p/sequel-pro/
#
# Host: mysql01.online.production.bownty.net (MySQL 10.0.15-MariaDB-1~wheezy-log)
# Database: confluence
# Generation Time: 2015-01-08 12:07:19 +0000
# ************************************************************


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;


# Dump of table AO_187CCC_SIDEBAR_LINK
# ------------------------------------------------------------

CREATE TABLE `AO_187CCC_SIDEBAR_LINK` (
  `CATEGORY` varchar(255) DEFAULT NULL,
  `CUSTOM_ICON_CLASS` varchar(255) DEFAULT NULL,
  `CUSTOM_TITLE` varchar(255) DEFAULT NULL,
  `DEST_PAGE_ID` bigint(20) DEFAULT '0',
  `HARDCODED_URL` varchar(255) DEFAULT NULL,
  `HIDDEN` tinyint(1) DEFAULT NULL,
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `POSITION` int(11) DEFAULT '0',
  `SPACE_KEY` varchar(255) DEFAULT NULL,
  `TYPE` varchar(255) DEFAULT NULL,
  `WEB_ITEM_KEY` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table AO_21D670_WHITELIST_RULES
# ------------------------------------------------------------

CREATE TABLE `AO_21D670_WHITELIST_RULES` (
  `ALLOWINBOUND` tinyint(1) DEFAULT NULL,
  `EXPRESSION` longtext NOT NULL,
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `TYPE` varchar(255) NOT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table AO_38321B_CUSTOM_CONTENT_LINK
# ------------------------------------------------------------

CREATE TABLE `AO_38321B_CUSTOM_CONTENT_LINK` (
  `CONTENT_KEY` varchar(255) DEFAULT NULL,
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `LINK_LABEL` varchar(255) DEFAULT NULL,
  `LINK_URL` varchar(255) DEFAULT NULL,
  `SEQUENCE` int(11) DEFAULT '0',
  PRIMARY KEY (`ID`),
  KEY `index_ao_38321b_cus1828044926` (`CONTENT_KEY`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table AO_429490_RESPONSE
# ------------------------------------------------------------

CREATE TABLE `AO_429490_RESPONSE` (
  `ANSWER` tinyint(1) DEFAULT NULL,
  `DATE` datetime DEFAULT NULL,
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `PAGE_ID` bigint(20) DEFAULT NULL,
  `QUESTION_ID` varchar(255) DEFAULT NULL,
  `SPACE_KEY` varchar(255) DEFAULT NULL,
  `UTM_CONTENT` varchar(255) DEFAULT NULL,
  `UTM_MEDIUM` varchar(255) DEFAULT NULL,
  `UTM_SOURCE` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table AO_429490_SETTINGS
# ------------------------------------------------------------

CREATE TABLE `AO_429490_SETTINGS` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `KEY` varchar(255) DEFAULT NULL,
  `SPACE` varchar(255) DEFAULT NULL,
  `VALUE` int(11) DEFAULT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table AO_42E351_HEALTH_CHECK_ENTITY
# ------------------------------------------------------------

CREATE TABLE `AO_42E351_HEALTH_CHECK_ENTITY` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table AO_54C900_C_TEMPLATE_REF
# ------------------------------------------------------------

CREATE TABLE `AO_54C900_C_TEMPLATE_REF` (
  `CB_INDEX_PARENTID` int(11) DEFAULT NULL,
  `CB_PARENTID` int(11) DEFAULT NULL,
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `NAME` varchar(255) DEFAULT NULL,
  `PARENT_ID` int(11) DEFAULT NULL,
  `PLUGIN_CLONE` tinyint(1) DEFAULT NULL,
  `PLUGIN_MODULE_KEY` varchar(255) DEFAULT NULL,
  `TEMPLATE_ID` bigint(20) DEFAULT '0',
  `UUID` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`ID`),
  KEY `fk_ao_54c900_c_template_ref_parent_id` (`PARENT_ID`),
  KEY `fk_ao_54c900_c_template_ref_cb_index_parentid` (`CB_INDEX_PARENTID`),
  KEY `fk_ao_54c900_c_template_ref_cb_parentid` (`CB_PARENTID`),
  CONSTRAINT `fk_ao_54c900_c_template_ref_cb_index_parentid` FOREIGN KEY (`CB_INDEX_PARENTID`) REFERENCES `AO_54C900_CONTENT_BLUEPRINT_AO` (`ID`),
  CONSTRAINT `fk_ao_54c900_c_template_ref_cb_parentid` FOREIGN KEY (`CB_PARENTID`) REFERENCES `AO_54C900_CONTENT_BLUEPRINT_AO` (`ID`),
  CONSTRAINT `fk_ao_54c900_c_template_ref_parent_id` FOREIGN KEY (`PARENT_ID`) REFERENCES `AO_54C900_C_TEMPLATE_REF` (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table AO_54C900_CONTENT_BLUEPRINT_AO
# ------------------------------------------------------------

CREATE TABLE `AO_54C900_CONTENT_BLUEPRINT_AO` (
  `CREATE_RESULT` varchar(255) DEFAULT NULL,
  `HOW_TO_USE_TEMPLATE` varchar(255) DEFAULT NULL,
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `INDEX_KEY` varchar(255) DEFAULT NULL,
  `INDEX_TITLE_I18N_KEY` varchar(255) DEFAULT NULL,
  `NAME` varchar(255) DEFAULT NULL,
  `PLUGIN_CLONE` tinyint(1) DEFAULT NULL,
  `PLUGIN_MODULE_KEY` varchar(255) DEFAULT NULL,
  `SPACE_KEY` varchar(255) DEFAULT NULL,
  `UUID` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table AO_54C900_SPACE_BLUEPRINT_AO
# ------------------------------------------------------------

CREATE TABLE `AO_54C900_SPACE_BLUEPRINT_AO` (
  `CATEGORY` varchar(255) DEFAULT NULL,
  `HOME_PAGE_ID` int(11) DEFAULT NULL,
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `NAME` varchar(255) DEFAULT NULL,
  `PLUGIN_CLONE` tinyint(1) DEFAULT NULL,
  `PLUGIN_MODULE_KEY` varchar(255) DEFAULT NULL,
  `PROMOTED_BPS` longtext,
  `UUID` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`ID`),
  KEY `fk_ao_54c900_space_blueprint_ao_home_page_id` (`HOME_PAGE_ID`),
  CONSTRAINT `fk_ao_54c900_space_blueprint_ao_home_page_id` FOREIGN KEY (`HOME_PAGE_ID`) REFERENCES `AO_54C900_C_TEMPLATE_REF` (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table AO_5F3884_FEATURE_DISCOVERY
# ------------------------------------------------------------

CREATE TABLE `AO_5F3884_FEATURE_DISCOVERY` (
  `DISCOVERED` tinyint(1) DEFAULT NULL,
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `USER_KEY` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table AO_6384AB_FEATURE_METADATA_AO
# ------------------------------------------------------------

CREATE TABLE `AO_6384AB_FEATURE_METADATA_AO` (
  `CONTEXT` varchar(255) DEFAULT NULL,
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `INSTALLATION_DATE` datetime DEFAULT NULL,
  `KEY` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table AO_92296B_AORECENTLY_VIEWED
# ------------------------------------------------------------

CREATE TABLE `AO_92296B_AORECENTLY_VIEWED` (
  `CONTENT_ID` bigint(20) DEFAULT NULL,
  `ID` bigint(20) NOT NULL AUTO_INCREMENT,
  `LAST_VIEW_DATE` datetime DEFAULT NULL,
  `SPACE_KEY` varchar(255) DEFAULT NULL,
  `USER_KEY` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`ID`),
  KEY `index_ao_92296b_aor1216492770` (`CONTENT_ID`),
  KEY `index_ao_92296b_aor1615591099` (`SPACE_KEY`),
  KEY `index_ao_92296b_aor426054036` (`USER_KEY`),
  KEY `index_ao_92296b_aor205355936` (`LAST_VIEW_DATE`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table AO_9412A1_AONOTIFICATION
# ------------------------------------------------------------

CREATE TABLE `AO_9412A1_AONOTIFICATION` (
  `ACTION` varchar(255) DEFAULT NULL,
  `ACTION_ICON_URL` longtext,
  `APPLICATION` varchar(255) DEFAULT NULL,
  `APPLICATION_LINK_ID` varchar(255) DEFAULT NULL,
  `CREATED` datetime DEFAULT NULL,
  `DESCRIPTION` longtext,
  `ENTITY` varchar(255) DEFAULT NULL,
  `GLOBAL_ID` varchar(255) DEFAULT NULL,
  `GROUPING_ID` varchar(255) DEFAULT NULL,
  `ICON_URL` longtext,
  `ID` bigint(20) NOT NULL AUTO_INCREMENT,
  `ITEM_ICON_URL` longtext,
  `ITEM_TITLE` longtext,
  `ITEM_URL` longtext,
  `METADATA` longtext,
  `PINNED` tinyint(1) DEFAULT '0',
  `READ` tinyint(1) DEFAULT '0',
  `STATUS` varchar(255) DEFAULT NULL,
  `TITLE` longtext,
  `UPDATED` datetime DEFAULT NULL,
  `URL` longtext,
  `USER` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`ID`),
  KEY `index_ao_9412a1_aon1547032463` (`CREATED`),
  KEY `index_ao_9412a1_aon849931648` (`GLOBAL_ID`),
  KEY `index_ao_9412a1_aon648423710` (`USER`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table AO_9412A1_AOREGISTRATION
# ------------------------------------------------------------

CREATE TABLE `AO_9412A1_AOREGISTRATION` (
  `DATA` longtext,
  `ID` varchar(255) NOT NULL,
  `UPDATED` datetime DEFAULT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table AO_9412A1_AOTASK
# ------------------------------------------------------------

CREATE TABLE `AO_9412A1_AOTASK` (
  `APPLICATION` varchar(255) DEFAULT NULL,
  `APPLICATION_LINK_ID` varchar(255) DEFAULT NULL,
  `CREATED` datetime DEFAULT NULL,
  `DESCRIPTION` longtext,
  `ENTITY` varchar(255) DEFAULT NULL,
  `GLOBAL_ID` varchar(255) DEFAULT NULL,
  `ID` bigint(20) NOT NULL AUTO_INCREMENT,
  `ITEM_ICON_URL` longtext,
  `ITEM_TITLE` longtext,
  `METADATA` longtext,
  `STATUS` varchar(255) DEFAULT NULL,
  `TITLE` longtext,
  `UPDATED` datetime DEFAULT NULL,
  `URL` longtext,
  `USER` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`ID`),
  KEY `index_ao_9412a1_aotask_user` (`USER`),
  KEY `index_ao_9412a1_aot1465568358` (`GLOBAL_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table AO_9412A1_AOUSER
# ------------------------------------------------------------

CREATE TABLE `AO_9412A1_AOUSER` (
  `CREATED` datetime DEFAULT NULL,
  `ID` bigint(20) NOT NULL AUTO_INCREMENT,
  `LAST_READ_NOTIFICATION_ID` bigint(20) DEFAULT '0',
  `TASK_ORDERING` longtext,
  `UPDATED` datetime DEFAULT NULL,
  `USERNAME` varchar(255) NOT NULL,
  PRIMARY KEY (`ID`),
  UNIQUE KEY `U_AO_9412A1_AOUSER_USERNAME` (`USERNAME`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table AO_9412A1_USER_APP_LINK
# ------------------------------------------------------------

CREATE TABLE `AO_9412A1_USER_APP_LINK` (
  `APPLICATION_LINK_ID` varchar(255) DEFAULT NULL,
  `AUTH_VERIFIED` tinyint(1) DEFAULT NULL,
  `CREATED` datetime DEFAULT NULL,
  `ID` bigint(20) NOT NULL AUTO_INCREMENT,
  `UPDATED` datetime DEFAULT NULL,
  `USER_ID` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`ID`),
  KEY `fk_ao_9412a1_user_app_link_user_id` (`USER_ID`),
  KEY `index_ao_9412a1_use643533071` (`APPLICATION_LINK_ID`),
  CONSTRAINT `fk_ao_9412a1_user_app_link_user_id` FOREIGN KEY (`USER_ID`) REFERENCES `AO_9412A1_AOUSER` (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table AO_A0B856_WEB_HOOK_LISTENER_AO
# ------------------------------------------------------------

CREATE TABLE `AO_A0B856_WEB_HOOK_LISTENER_AO` (
  `ENABLED` tinyint(1) DEFAULT NULL,
  `EVENTS` longtext,
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `LAST_UPDATED` datetime NOT NULL,
  `LAST_UPDATED_USER` varchar(255) DEFAULT NULL,
  `NAME` longtext NOT NULL,
  `PARAMETERS` longtext,
  `REGISTRATION_METHOD` varchar(255) NOT NULL,
  `URL` longtext NOT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table AO_DC98AE_AOHELP_TIP
# ------------------------------------------------------------

CREATE TABLE `AO_DC98AE_AOHELP_TIP` (
  `DISMISSED_HELP_TIP` varchar(255) DEFAULT NULL,
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `USER_KEY` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`ID`),
  KEY `index_ao_dc98ae_aoh1533992358` (`USER_KEY`),
  KEY `index_ao_dc98ae_aoh411805038` (`DISMISSED_HELP_TIP`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table AO_EF9604_FEATURE_DISCOVERY
# ------------------------------------------------------------

CREATE TABLE `AO_EF9604_FEATURE_DISCOVERY` (
  `DISCOVERED` tinyint(1) DEFAULT NULL,
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `USER_KEY` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table ATTACHMENTDATA
# ------------------------------------------------------------

CREATE TABLE `ATTACHMENTDATA` (
  `ATTACHMENTDATAID` bigint(20) NOT NULL,
  `ATTVERSION` int(11) NOT NULL,
  `DATA` longblob,
  `ATTACHMENTID` bigint(20) NOT NULL,
  PRIMARY KEY (`ATTACHMENTDATAID`),
  UNIQUE KEY `ATTACHMENTID` (`ATTACHMENTID`),
  KEY `attch_idver_idx` (`ATTVERSION`,`ATTACHMENTID`),
  CONSTRAINT `FK9DC3E34D34A4917E` FOREIGN KEY (`ATTACHMENTID`) REFERENCES `ATTACHMENTS` (`ATTACHMENTID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table ATTACHMENTS
# ------------------------------------------------------------

CREATE TABLE `ATTACHMENTS` (
  `ATTACHMENTID` bigint(20) NOT NULL,
  `TITLE` varchar(255) NOT NULL,
  `CONTENTTYPE` varchar(255) NOT NULL,
  `PAGEID` bigint(20) NOT NULL,
  `CREATOR` varchar(255) DEFAULT NULL,
  `CREATIONDATE` datetime DEFAULT NULL,
  `LASTMODIFIER` varchar(255) DEFAULT NULL,
  `LASTMODDATE` datetime DEFAULT NULL,
  `FILESIZE` bigint(20) DEFAULT NULL,
  `ATTACHMENT_COMMENT` varchar(255) DEFAULT NULL,
  `ATTVERSION` int(11) DEFAULT NULL,
  `PREVVER` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`ATTACHMENTID`),
  KEY `att_prevver_idx` (`PREVVER`),
  KEY `att_pageid_idx` (`PAGEID`),
  KEY `FK_ATTACHMENTS_LASTMODIFIER` (`LASTMODIFIER`),
  KEY `FK_ATTACHMENTS_CREATOR` (`CREATOR`),
  CONSTRAINT `FK54475F9017D4A070` FOREIGN KEY (`PREVVER`) REFERENCES `ATTACHMENTS` (`ATTACHMENTID`),
  CONSTRAINT `FK54475F908C38FBEA` FOREIGN KEY (`PAGEID`) REFERENCES `CONTENT` (`CONTENTID`),
  CONSTRAINT `FK_ATTACHMENTS_CREATOR` FOREIGN KEY (`CREATOR`) REFERENCES `user_mapping` (`user_key`),
  CONSTRAINT `FK_ATTACHMENTS_LASTMODIFIER` FOREIGN KEY (`LASTMODIFIER`) REFERENCES `user_mapping` (`user_key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table BANDANA
# ------------------------------------------------------------

CREATE TABLE `BANDANA` (
  `BANDANAID` bigint(20) NOT NULL,
  `BANDANACONTEXT` varchar(255) NOT NULL,
  `BANDANAKEY` varchar(100) NOT NULL,
  `BANDANAVALUE` mediumtext,
  PRIMARY KEY (`BANDANAID`),
  UNIQUE KEY `bandana_unique_key` (`BANDANACONTEXT`,`BANDANAKEY`),
  KEY `band_context_idx` (`BANDANACONTEXT`),
  KEY `band_cont_key_idx` (`BANDANACONTEXT`,`BANDANAKEY`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table BODYCONTENT
# ------------------------------------------------------------

CREATE TABLE `BODYCONTENT` (
  `BODYCONTENTID` bigint(20) NOT NULL,
  `BODY` longtext,
  `CONTENTID` bigint(20) DEFAULT NULL,
  `BODYTYPEID` smallint(6) DEFAULT NULL,
  PRIMARY KEY (`BODYCONTENTID`),
  KEY `body_content_idx` (`CONTENTID`),
  CONSTRAINT `FKA898D4778DD41734` FOREIGN KEY (`CONTENTID`) REFERENCES `CONTENT` (`CONTENTID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table CLUSTERSAFETY
# ------------------------------------------------------------

CREATE TABLE `CLUSTERSAFETY` (
  `CLUSTERSAFETYID` bigint(20) NOT NULL,
  `SAFETYNUMBER` int(11) DEFAULT NULL,
  PRIMARY KEY (`CLUSTERSAFETYID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table CONFANCESTORS
# ------------------------------------------------------------

CREATE TABLE `CONFANCESTORS` (
  `DESCENDENTID` bigint(20) NOT NULL,
  `ANCESTORID` bigint(20) NOT NULL,
  `ANCESTORPOSITION` int(11) NOT NULL,
  PRIMARY KEY (`DESCENDENTID`,`ANCESTORPOSITION`),
  KEY `c_ancestorid_idx` (`ANCESTORID`),
  CONSTRAINT `FK9494E23C37E35A2E` FOREIGN KEY (`ANCESTORID`) REFERENCES `CONTENT` (`CONTENTID`),
  CONSTRAINT `FK9494E23CC45E94DC` FOREIGN KEY (`DESCENDENTID`) REFERENCES `CONTENT` (`CONTENTID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table CONFVERSION
# ------------------------------------------------------------

CREATE TABLE `CONFVERSION` (
  `CONFVERSIONID` bigint(20) NOT NULL,
  `BUILDNUMBER` int(11) NOT NULL,
  `INSTALLDATE` datetime DEFAULT NULL,
  `VERSIONTAG` varchar(255) DEFAULT NULL,
  `CREATIONDATE` datetime DEFAULT NULL,
  `LASTMODDATE` datetime DEFAULT NULL,
  PRIMARY KEY (`CONFVERSIONID`),
  UNIQUE KEY `BUILDNUMBER` (`BUILDNUMBER`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table CONTENT
# ------------------------------------------------------------

CREATE TABLE `CONTENT` (
  `CONTENTID` bigint(20) NOT NULL,
  `CONTENTTYPE` varchar(255) NOT NULL,
  `TITLE` varchar(255) DEFAULT NULL,
  `VERSION` int(11) DEFAULT NULL,
  `CREATOR` varchar(255) DEFAULT NULL,
  `CREATIONDATE` datetime DEFAULT NULL,
  `LASTMODIFIER` varchar(255) DEFAULT NULL,
  `LASTMODDATE` datetime DEFAULT NULL,
  `VERSIONCOMMENT` mediumtext,
  `PREVVER` bigint(20) DEFAULT NULL,
  `CONTENT_STATUS` varchar(255) DEFAULT NULL,
  `SPACEID` bigint(20) DEFAULT NULL,
  `CHILD_POSITION` int(11) DEFAULT NULL,
  `PARENTID` bigint(20) DEFAULT NULL,
  `MESSAGEID` varchar(255) DEFAULT NULL,
  `PLUGINKEY` varchar(255) DEFAULT NULL,
  `PLUGINVER` varchar(255) DEFAULT NULL,
  `PARENTCCID` bigint(20) DEFAULT NULL,
  `DRAFTPAGEID` varchar(255) DEFAULT NULL,
  `DRAFTSPACEKEY` varchar(255) DEFAULT NULL,
  `DRAFTTYPE` varchar(255) DEFAULT NULL,
  `DRAFTPAGEVERSION` int(11) DEFAULT NULL,
  `PAGEID` bigint(20) DEFAULT NULL,
  `PARENTCOMMENTID` bigint(20) DEFAULT NULL,
  `USERNAME` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`CONTENTID`),
  KEY `c_parentid_idx` (`PARENTID`),
  KEY `c_parentccid_idx` (`PARENTCCID`),
  KEY `c_spaceid_idx` (`SPACEID`),
  KEY `c_pageid_idx` (`PAGEID`),
  KEY `c_draftpageid_idx` (`DRAFTPAGEID`),
  KEY `c_messageid_idx` (`MESSAGEID`),
  KEY `c_title_idx` (`TITLE`),
  KEY `c_prevver_idx` (`PREVVER`),
  KEY `c_parentcommid_idx` (`PARENTCOMMENTID`),
  KEY `c_drafttype_idx` (`DRAFTTYPE`),
  KEY `FK_CONTENT_CREATOR` (`CREATOR`),
  KEY `FK_CONTENT_USERNAME` (`USERNAME`),
  KEY `FK_CONTENT_LASTMODIFIER` (`LASTMODIFIER`),
  CONSTRAINT `FK6382C05917D4A070` FOREIGN KEY (`PREVVER`) REFERENCES `CONTENT` (`CONTENTID`),
  CONSTRAINT `FK6382C05974B18345` FOREIGN KEY (`PARENTID`) REFERENCES `CONTENT` (`CONTENTID`),
  CONSTRAINT `FK6382C0598C38FBEA` FOREIGN KEY (`PAGEID`) REFERENCES `CONTENT` (`CONTENTID`),
  CONSTRAINT `FK6382C059B2DC6081` FOREIGN KEY (`SPACEID`) REFERENCES `SPACES` (`SPACEID`),
  CONSTRAINT `FK6382C059B97E9230` FOREIGN KEY (`PARENTCOMMENTID`) REFERENCES `CONTENT` (`CONTENTID`),
  CONSTRAINT `FK6382C059E5B1125` FOREIGN KEY (`PARENTCCID`) REFERENCES `CONTENT` (`CONTENTID`),
  CONSTRAINT `FK_CONTENT_CREATOR` FOREIGN KEY (`CREATOR`) REFERENCES `user_mapping` (`user_key`),
  CONSTRAINT `FK_CONTENT_LASTMODIFIER` FOREIGN KEY (`LASTMODIFIER`) REFERENCES `user_mapping` (`user_key`),
  CONSTRAINT `FK_CONTENT_USERNAME` FOREIGN KEY (`USERNAME`) REFERENCES `user_mapping` (`user_key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table CONTENT_LABEL
# ------------------------------------------------------------

CREATE TABLE `CONTENT_LABEL` (
  `ID` bigint(20) NOT NULL,
  `LABELID` bigint(20) NOT NULL,
  `CONTENTID` bigint(20) DEFAULT NULL,
  `ATTACHMENTID` bigint(20) DEFAULT NULL,
  `PAGETEMPLATEID` bigint(20) DEFAULT NULL,
  `OWNER` varchar(255) DEFAULT NULL,
  `CREATIONDATE` datetime DEFAULT NULL,
  `LASTMODDATE` datetime DEFAULT NULL,
  `LABELABLEID` bigint(20) DEFAULT NULL,
  `LABELABLETYPE` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`ID`),
  KEY `cl_attachmentid_idx` (`ATTACHMENTID`),
  KEY `cl_contentid_idx` (`CONTENTID`),
  KEY `cl_labelid_idx` (`LABELID`),
  KEY `cl_pagetemplateid_idx` (`PAGETEMPLATEID`),
  KEY `cl_lastmoddate_idx` (`LASTMODDATE`),
  KEY `cl_labelable_idx` (`LABELABLEID`,`LABELABLETYPE`),
  KEY `FK_CONTENT_LABEL_OWNER` (`OWNER`),
  CONSTRAINT `FKF0E7436E27072AEF` FOREIGN KEY (`LABELID`) REFERENCES `LABEL` (`LABELID`),
  CONSTRAINT `FKF0E7436E34A4917E` FOREIGN KEY (`ATTACHMENTID`) REFERENCES `ATTACHMENTS` (`ATTACHMENTID`),
  CONSTRAINT `FKF0E7436E8DD41734` FOREIGN KEY (`CONTENTID`) REFERENCES `CONTENT` (`CONTENTID`),
  CONSTRAINT `FKF0E7436ED32042E4` FOREIGN KEY (`PAGETEMPLATEID`) REFERENCES `PAGETEMPLATES` (`TEMPLATEID`),
  CONSTRAINT `FK_CONTENT_LABEL_OWNER` FOREIGN KEY (`OWNER`) REFERENCES `user_mapping` (`user_key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table CONTENT_PERM
# ------------------------------------------------------------

CREATE TABLE `CONTENT_PERM` (
  `ID` bigint(20) NOT NULL,
  `CP_TYPE` varchar(10) NOT NULL,
  `USERNAME` varchar(255) DEFAULT NULL,
  `GROUPNAME` varchar(255) DEFAULT NULL,
  `CPS_ID` bigint(20) NOT NULL,
  `CREATOR` varchar(255) DEFAULT NULL,
  `CREATIONDATE` datetime DEFAULT NULL,
  `LASTMODIFIER` varchar(255) DEFAULT NULL,
  `LASTMODDATE` datetime DEFAULT NULL,
  PRIMARY KEY (`ID`),
  UNIQUE KEY `cp_unique_user` (`CPS_ID`,`CP_TYPE`,`USERNAME`),
  UNIQUE KEY `cp_unique_group` (`CPS_ID`,`CP_TYPE`,`GROUPNAME`),
  KEY `cp_gn_idx` (`GROUPNAME`),
  KEY `cp_os_idx` (`CPS_ID`),
  KEY `FK_CONTENT_PERM_LASTMODIFIER` (`LASTMODIFIER`),
  KEY `FK_CONTENT_PERM_USERNAME` (`USERNAME`),
  KEY `FK_CONTENT_PERM_CREATOR` (`CREATOR`),
  CONSTRAINT `FKBD74B31676E33274` FOREIGN KEY (`CPS_ID`) REFERENCES `CONTENT_PERM_SET` (`ID`),
  CONSTRAINT `FK_CONTENT_PERM_CREATOR` FOREIGN KEY (`CREATOR`) REFERENCES `user_mapping` (`user_key`),
  CONSTRAINT `FK_CONTENT_PERM_LASTMODIFIER` FOREIGN KEY (`LASTMODIFIER`) REFERENCES `user_mapping` (`user_key`),
  CONSTRAINT `FK_CONTENT_PERM_USERNAME` FOREIGN KEY (`USERNAME`) REFERENCES `user_mapping` (`user_key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table CONTENT_PERM_SET
# ------------------------------------------------------------

CREATE TABLE `CONTENT_PERM_SET` (
  `ID` bigint(20) NOT NULL,
  `CONT_PERM_TYPE` varchar(10) NOT NULL,
  `CONTENT_ID` bigint(20) NOT NULL,
  `CREATIONDATE` datetime DEFAULT NULL,
  `LASTMODDATE` datetime DEFAULT NULL,
  PRIMARY KEY (`ID`),
  UNIQUE KEY `cps_unique_type` (`CONTENT_ID`,`CONT_PERM_TYPE`),
  KEY `cps_permtype_idx` (`CONT_PERM_TYPE`),
  KEY `cps_content_idx` (`CONTENT_ID`),
  CONSTRAINT `FKBF45A7992CAF22C1` FOREIGN KEY (`CONTENT_ID`) REFERENCES `CONTENT` (`CONTENTID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table CONTENTPROPERTIES
# ------------------------------------------------------------

CREATE TABLE `CONTENTPROPERTIES` (
  `PROPERTYID` bigint(20) NOT NULL,
  `PROPERTYNAME` varchar(255) NOT NULL,
  `STRINGVAL` varchar(255) DEFAULT NULL,
  `LONGVAL` bigint(20) DEFAULT NULL,
  `DATEVAL` datetime DEFAULT NULL,
  `CONTENTID` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`PROPERTYID`),
  KEY `content_prop_str_idx` (`STRINGVAL`),
  KEY `content_prop_long_idx` (`LONGVAL`),
  KEY `c_contentproperties_idx` (`CONTENTID`),
  KEY `content_prop_name_idx` (`PROPERTYNAME`),
  KEY `content_prop_date_idx` (`DATEVAL`),
  CONSTRAINT `FK984C5E4C8DD41734` FOREIGN KEY (`CONTENTID`) REFERENCES `CONTENT` (`CONTENTID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table cwd_app_dir_group_mapping
# ------------------------------------------------------------

CREATE TABLE `cwd_app_dir_group_mapping` (
  `id` bigint(20) NOT NULL,
  `app_dir_mapping_id` bigint(20) NOT NULL,
  `application_id` bigint(20) NOT NULL,
  `directory_id` bigint(20) NOT NULL,
  `group_name` varchar(255) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_app_dir_group_group_dir` (`directory_id`,`group_name`),
  KEY `fk_app_dir_group_app` (`application_id`),
  KEY `fk_app_dir_group_mapping` (`app_dir_mapping_id`),
  CONSTRAINT `fk_app_dir_group_app` FOREIGN KEY (`application_id`) REFERENCES `cwd_application` (`id`),
  CONSTRAINT `fk_app_dir_group_dir` FOREIGN KEY (`directory_id`) REFERENCES `cwd_directory` (`id`),
  CONSTRAINT `fk_app_dir_group_mapping` FOREIGN KEY (`app_dir_mapping_id`) REFERENCES `cwd_app_dir_mapping` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table cwd_app_dir_mapping
# ------------------------------------------------------------

CREATE TABLE `cwd_app_dir_mapping` (
  `id` bigint(20) NOT NULL,
  `application_id` bigint(20) DEFAULT NULL,
  `directory_id` bigint(20) NOT NULL,
  `allow_all` char(1) NOT NULL,
  `list_index` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `fk_app_dir_dir` (`directory_id`),
  KEY `FK52050E2FB347AA6A` (`application_id`),
  CONSTRAINT `FK52050E2FB347AA6A` FOREIGN KEY (`application_id`) REFERENCES `cwd_application` (`id`),
  CONSTRAINT `fk_app_dir_dir` FOREIGN KEY (`directory_id`) REFERENCES `cwd_directory` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table cwd_app_dir_operation
# ------------------------------------------------------------

CREATE TABLE `cwd_app_dir_operation` (
  `app_dir_mapping_id` bigint(20) NOT NULL,
  `operation_type` varchar(32) NOT NULL,
  PRIMARY KEY (`app_dir_mapping_id`,`operation_type`),
  CONSTRAINT `fk_app_dir_mapping` FOREIGN KEY (`app_dir_mapping_id`) REFERENCES `cwd_app_dir_mapping` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table cwd_application
# ------------------------------------------------------------

CREATE TABLE `cwd_application` (
  `id` bigint(20) NOT NULL,
  `application_name` varchar(255) NOT NULL,
  `lower_application_name` varchar(255) NOT NULL,
  `created_date` datetime NOT NULL,
  `updated_date` datetime NOT NULL,
  `active` char(1) NOT NULL,
  `description` varchar(255) DEFAULT NULL,
  `application_type` varchar(32) NOT NULL,
  `credential` varchar(255) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `lower_application_name` (`lower_application_name`),
  KEY `idx_app_active` (`active`),
  KEY `idx_app_type` (`application_type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table cwd_application_address
# ------------------------------------------------------------

CREATE TABLE `cwd_application_address` (
  `application_id` bigint(20) NOT NULL,
  `remote_address` varchar(255) NOT NULL,
  PRIMARY KEY (`application_id`,`remote_address`),
  CONSTRAINT `fk_application_address` FOREIGN KEY (`application_id`) REFERENCES `cwd_application` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table cwd_application_attribute
# ------------------------------------------------------------

CREATE TABLE `cwd_application_attribute` (
  `application_id` bigint(20) NOT NULL,
  `attribute_value` text,
  `attribute_name` varchar(255) NOT NULL,
  PRIMARY KEY (`application_id`,`attribute_name`),
  CONSTRAINT `fk_application_attribute` FOREIGN KEY (`application_id`) REFERENCES `cwd_application` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table cwd_directory
# ------------------------------------------------------------

CREATE TABLE `cwd_directory` (
  `id` bigint(20) NOT NULL,
  `directory_name` varchar(255) NOT NULL,
  `lower_directory_name` varchar(255) NOT NULL,
  `created_date` datetime NOT NULL,
  `updated_date` datetime NOT NULL,
  `active` char(1) NOT NULL,
  `description` varchar(255) DEFAULT NULL,
  `impl_class` varchar(255) NOT NULL,
  `lower_impl_class` varchar(255) NOT NULL,
  `directory_type` varchar(32) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `lower_directory_name` (`lower_directory_name`),
  KEY `idx_dir_type` (`directory_type`),
  KEY `idx_dir_active` (`active`),
  KEY `idx_dir_l_impl_class` (`lower_impl_class`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table cwd_directory_attribute
# ------------------------------------------------------------

CREATE TABLE `cwd_directory_attribute` (
  `directory_id` bigint(20) NOT NULL,
  `attribute_value` text,
  `attribute_name` varchar(255) NOT NULL,
  PRIMARY KEY (`directory_id`,`attribute_name`),
  CONSTRAINT `fk_directory_attribute` FOREIGN KEY (`directory_id`) REFERENCES `cwd_directory` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table cwd_directory_operation
# ------------------------------------------------------------

CREATE TABLE `cwd_directory_operation` (
  `directory_id` bigint(20) NOT NULL,
  `operation_type` varchar(32) NOT NULL,
  PRIMARY KEY (`directory_id`,`operation_type`),
  CONSTRAINT `fk_directory_operation` FOREIGN KEY (`directory_id`) REFERENCES `cwd_directory` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table cwd_group
# ------------------------------------------------------------

CREATE TABLE `cwd_group` (
  `id` bigint(20) NOT NULL,
  `group_name` varchar(255) NOT NULL,
  `lower_group_name` varchar(255) NOT NULL,
  `active` char(1) NOT NULL,
  `local` char(1) NOT NULL,
  `created_date` datetime NOT NULL,
  `updated_date` datetime NOT NULL,
  `description` varchar(255) DEFAULT NULL,
  `group_type` varchar(32) NOT NULL,
  `directory_id` bigint(20) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `cwd_group_name_dir_id` (`lower_group_name`,`directory_id`),
  KEY `idx_group_active` (`active`,`directory_id`),
  KEY `idx_group_dir_id` (`directory_id`),
  CONSTRAINT `fk_directory_id` FOREIGN KEY (`directory_id`) REFERENCES `cwd_directory` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table cwd_group_attribute
# ------------------------------------------------------------

CREATE TABLE `cwd_group_attribute` (
  `id` bigint(20) NOT NULL,
  `group_id` bigint(20) NOT NULL,
  `directory_id` bigint(20) NOT NULL,
  `attribute_name` varchar(255) NOT NULL,
  `attribute_value` varchar(255) DEFAULT NULL,
  `attribute_lower_value` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `cwd_unique_grp_attr` (`directory_id`,`group_id`,`attribute_name`,`attribute_lower_value`),
  KEY `idx_group_attr_dir_name_lval` (`directory_id`,`attribute_name`,`attribute_lower_value`),
  KEY `idx_group_attr_group_id` (`group_id`),
  CONSTRAINT `fk_group_attr_dir_id` FOREIGN KEY (`directory_id`) REFERENCES `cwd_directory` (`id`),
  CONSTRAINT `fk_group_attr_id_group_id` FOREIGN KEY (`group_id`) REFERENCES `cwd_group` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table cwd_membership
# ------------------------------------------------------------

CREATE TABLE `cwd_membership` (
  `id` bigint(20) NOT NULL,
  `parent_id` bigint(20) NOT NULL,
  `child_group_id` bigint(20) DEFAULT NULL,
  `child_user_id` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `cwd_unique_user_membership` (`parent_id`,`child_user_id`),
  UNIQUE KEY `cwd_unique_group_membership` (`parent_id`,`child_group_id`),
  KEY `idx_mem_dir_child` (`child_group_id`,`child_user_id`),
  KEY `idx_mem_dir_parent` (`parent_id`),
  KEY `idx_mem_dir_parent_child` (`parent_id`,`child_group_id`,`child_user_id`),
  KEY `fk_child_user` (`child_user_id`),
  CONSTRAINT `fk_child_grp` FOREIGN KEY (`child_group_id`) REFERENCES `cwd_group` (`id`),
  CONSTRAINT `fk_child_user` FOREIGN KEY (`child_user_id`) REFERENCES `cwd_user` (`id`),
  CONSTRAINT `fk_parent_grp` FOREIGN KEY (`parent_id`) REFERENCES `cwd_group` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table cwd_user
# ------------------------------------------------------------

CREATE TABLE `cwd_user` (
  `id` bigint(20) NOT NULL,
  `user_name` varchar(255) NOT NULL,
  `lower_user_name` varchar(255) NOT NULL,
  `active` char(1) NOT NULL,
  `created_date` datetime NOT NULL,
  `updated_date` datetime NOT NULL,
  `first_name` varchar(255) DEFAULT NULL,
  `lower_first_name` varchar(255) DEFAULT NULL,
  `last_name` varchar(255) DEFAULT NULL,
  `lower_last_name` varchar(255) DEFAULT NULL,
  `display_name` varchar(255) DEFAULT NULL,
  `lower_display_name` varchar(255) DEFAULT NULL,
  `email_address` varchar(255) DEFAULT NULL,
  `lower_email_address` varchar(255) DEFAULT NULL,
  `external_id` varchar(255) DEFAULT NULL,
  `directory_id` bigint(20) NOT NULL,
  `credential` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `cwd_user_name_dir_id` (`lower_user_name`,`directory_id`),
  KEY `idx_user_lower_display_name` (`lower_display_name`,`directory_id`),
  KEY `idx_user_lower_last_name` (`lower_last_name`,`directory_id`),
  KEY `idx_user_active` (`active`,`directory_id`),
  KEY `idx_user_external_id` (`external_id`),
  KEY `idx_user_name_dir_id` (`directory_id`),
  KEY `idx_user_lower_first_name` (`lower_first_name`,`directory_id`),
  KEY `idx_user_lower_email_address` (`lower_email_address`,`directory_id`),
  CONSTRAINT `fk_user_dir_id` FOREIGN KEY (`directory_id`) REFERENCES `cwd_directory` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table cwd_user_attribute
# ------------------------------------------------------------

CREATE TABLE `cwd_user_attribute` (
  `id` bigint(20) NOT NULL,
  `user_id` bigint(20) NOT NULL,
  `directory_id` bigint(20) NOT NULL,
  `attribute_name` varchar(255) NOT NULL,
  `attribute_value` varchar(255) DEFAULT NULL,
  `attribute_lower_value` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `cwd_unique_usr_attr` (`directory_id`,`user_id`,`attribute_name`,`attribute_lower_value`),
  KEY `idx_user_attr_dir_name_lval` (`directory_id`,`attribute_name`,`attribute_lower_value`),
  KEY `idx_user_attr_user_id` (`user_id`),
  CONSTRAINT `fk_user_attr_dir_id` FOREIGN KEY (`directory_id`) REFERENCES `cwd_directory` (`id`),
  CONSTRAINT `fk_user_attribute_id_user_id` FOREIGN KEY (`user_id`) REFERENCES `cwd_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table cwd_user_credential_record
# ------------------------------------------------------------

CREATE TABLE `cwd_user_credential_record` (
  `id` bigint(20) NOT NULL,
  `user_id` bigint(20) DEFAULT NULL,
  `password_hash` varchar(255) NOT NULL,
  `list_index` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `FK76F874F73AEE0F` (`user_id`),
  CONSTRAINT `FK76F874F73AEE0F` FOREIGN KEY (`user_id`) REFERENCES `cwd_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table DECORATOR
# ------------------------------------------------------------

CREATE TABLE `DECORATOR` (
  `DECORATORID` bigint(20) NOT NULL,
  `SPACEKEY` varchar(255) DEFAULT NULL,
  `DECORATORNAME` varchar(255) DEFAULT NULL,
  `BODY` mediumtext,
  `LASTMODDATE` datetime DEFAULT NULL,
  PRIMARY KEY (`DECORATORID`),
  KEY `dec_name_idx` (`DECORATORNAME`),
  KEY `dec_key_idx` (`SPACEKEY`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table external_entities
# ------------------------------------------------------------

CREATE TABLE `external_entities` (
  `id` bigint(20) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `type` varchar(255) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `ext_ent_name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table external_members
# ------------------------------------------------------------

CREATE TABLE `external_members` (
  `extentityid` bigint(20) NOT NULL,
  `groupid` bigint(20) NOT NULL,
  PRIMARY KEY (`groupid`,`extentityid`),
  KEY `c_extentityid_idx` (`extentityid`),
  CONSTRAINT `FKD8C8D8A5117D5FDA` FOREIGN KEY (`groupid`) REFERENCES `groups` (`id`),
  CONSTRAINT `FKD8C8D8A5F25E5D5F` FOREIGN KEY (`extentityid`) REFERENCES `external_entities` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table EXTRNLNKS
# ------------------------------------------------------------

CREATE TABLE `EXTRNLNKS` (
  `LINKID` bigint(20) NOT NULL,
  `CONTENTTYPE` varchar(255) NOT NULL,
  `VIEWCOUNT` int(11) NOT NULL,
  `URL` varchar(255) NOT NULL,
  `CONTENTID` bigint(20) NOT NULL,
  `CREATOR` varchar(255) DEFAULT NULL,
  `CREATIONDATE` datetime DEFAULT NULL,
  `LASTMODIFIER` varchar(255) DEFAULT NULL,
  `LASTMODDATE` datetime DEFAULT NULL,
  PRIMARY KEY (`LINKID`),
  KEY `el_contentid_idx` (`CONTENTID`),
  KEY `FK_EXTRNLNKS_LASTMODIFIER` (`LASTMODIFIER`),
  KEY `FK_EXTRNLNKS_CREATOR` (`CREATOR`),
  CONSTRAINT `FK97C10FE78DD41734` FOREIGN KEY (`CONTENTID`) REFERENCES `CONTENT` (`CONTENTID`),
  CONSTRAINT `FK_EXTRNLNKS_CREATOR` FOREIGN KEY (`CREATOR`) REFERENCES `user_mapping` (`user_key`),
  CONSTRAINT `FK_EXTRNLNKS_LASTMODIFIER` FOREIGN KEY (`LASTMODIFIER`) REFERENCES `user_mapping` (`user_key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table FOLLOW_CONNECTIONS
# ------------------------------------------------------------

CREATE TABLE `FOLLOW_CONNECTIONS` (
  `CONNECTIONID` bigint(20) NOT NULL,
  `FOLLOWER` varchar(255) DEFAULT NULL,
  `FOLLOWEE` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`CONNECTIONID`),
  KEY `FK_FOLLOW_CONNECTIONS_FOLLOWER` (`FOLLOWER`),
  KEY `FK_FOLLOW_CONNECTIONS_FOLLOWEE` (`FOLLOWEE`),
  CONSTRAINT `FK_FOLLOW_CONNECTIONS_FOLLOWEE` FOREIGN KEY (`FOLLOWEE`) REFERENCES `user_mapping` (`user_key`),
  CONSTRAINT `FK_FOLLOW_CONNECTIONS_FOLLOWER` FOREIGN KEY (`FOLLOWER`) REFERENCES `user_mapping` (`user_key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table groups
# ------------------------------------------------------------

CREATE TABLE `groups` (
  `id` bigint(20) NOT NULL,
  `groupname` varchar(255) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `groupname` (`groupname`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table hibernate_unique_key
# ------------------------------------------------------------

CREATE TABLE `hibernate_unique_key` (
  `next_hi` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table IMAGEDETAILS
# ------------------------------------------------------------

CREATE TABLE `IMAGEDETAILS` (
  `ATTACHMENTID` bigint(20) NOT NULL,
  `HEIGHT` int(11) DEFAULT NULL,
  `WIDTH` int(11) DEFAULT NULL,
  `MIMETYPE` varchar(30) DEFAULT NULL,
  PRIMARY KEY (`ATTACHMENTID`),
  CONSTRAINT `FKA768048734A4917E` FOREIGN KEY (`ATTACHMENTID`) REFERENCES `ATTACHMENTS` (`ATTACHMENTID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table INDEXQUEUEENTRIES
# ------------------------------------------------------------

CREATE TABLE `INDEXQUEUEENTRIES` (
  `ENTRYID` bigint(20) NOT NULL,
  `CREATIONDATE` datetime DEFAULT NULL,
  `TYPE` int(11) DEFAULT NULL,
  `HANDLE` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`ENTRYID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table KEYSTORE
# ------------------------------------------------------------

CREATE TABLE `KEYSTORE` (
  `KEYID` bigint(20) NOT NULL,
  `ALIAS` varchar(255) NOT NULL,
  `TYPE` varchar(32) NOT NULL,
  `ALGORITHM` varchar(32) NOT NULL,
  `KEYSPEC` text NOT NULL,
  PRIMARY KEY (`KEYID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table LABEL
# ------------------------------------------------------------

CREATE TABLE `LABEL` (
  `LABELID` bigint(20) NOT NULL,
  `NAME` varchar(255) DEFAULT NULL,
  `OWNER` varchar(255) DEFAULT NULL,
  `NAMESPACE` varchar(255) DEFAULT NULL,
  `CREATIONDATE` datetime DEFAULT NULL,
  `LASTMODDATE` datetime DEFAULT NULL,
  PRIMARY KEY (`LABELID`),
  KEY `l_name_idx` (`NAME`),
  KEY `l_namespace_idx` (`NAMESPACE`),
  KEY `FK_LABEL_OWNER` (`OWNER`),
  CONSTRAINT `FK_LABEL_OWNER` FOREIGN KEY (`OWNER`) REFERENCES `user_mapping` (`user_key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table LIKES
# ------------------------------------------------------------

CREATE TABLE `LIKES` (
  `ID` bigint(20) NOT NULL,
  `CONTENTID` bigint(20) NOT NULL,
  `USERNAME` varchar(255) NOT NULL,
  `CREATIONDATE` datetime NOT NULL,
  PRIMARY KEY (`ID`),
  KEY `FK_LIKES_USERNAME` (`USERNAME`),
  KEY `FK4514B9C8DD41734` (`CONTENTID`),
  CONSTRAINT `FK4514B9C8DD41734` FOREIGN KEY (`CONTENTID`) REFERENCES `CONTENT` (`CONTENTID`),
  CONSTRAINT `FK_LIKES_USERNAME` FOREIGN KEY (`USERNAME`) REFERENCES `user_mapping` (`user_key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table LINKS
# ------------------------------------------------------------

CREATE TABLE `LINKS` (
  `LINKID` bigint(20) NOT NULL,
  `DESTPAGETITLE` varchar(255) DEFAULT NULL,
  `DESTSPACEKEY` varchar(255) NOT NULL,
  `CONTENTID` bigint(20) NOT NULL,
  `CREATOR` varchar(255) DEFAULT NULL,
  `CREATIONDATE` datetime DEFAULT NULL,
  `LASTMODIFIER` varchar(255) DEFAULT NULL,
  `LASTMODDATE` datetime DEFAULT NULL,
  PRIMARY KEY (`LINKID`),
  KEY `l_contentid_idx` (`CONTENTID`),
  KEY `l_destspacekey_idx` (`DESTSPACEKEY`),
  KEY `FK_LINKS_LASTMODIFIER` (`LASTMODIFIER`),
  KEY `FK_LINKS_CREATOR` (`CREATOR`),
  CONSTRAINT `FK45157998DD41734` FOREIGN KEY (`CONTENTID`) REFERENCES `CONTENT` (`CONTENTID`),
  CONSTRAINT `FK_LINKS_CREATOR` FOREIGN KEY (`CREATOR`) REFERENCES `user_mapping` (`user_key`),
  CONSTRAINT `FK_LINKS_LASTMODIFIER` FOREIGN KEY (`LASTMODIFIER`) REFERENCES `user_mapping` (`user_key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table local_members
# ------------------------------------------------------------

CREATE TABLE `local_members` (
  `userid` bigint(20) NOT NULL,
  `groupid` bigint(20) NOT NULL,
  PRIMARY KEY (`groupid`,`userid`),
  KEY `c_userid_idx` (`userid`),
  CONSTRAINT `FK6B8FB445117D5FDA` FOREIGN KEY (`groupid`) REFERENCES `groups` (`id`),
  CONSTRAINT `FK6B8FB445CE2B3226` FOREIGN KEY (`userid`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table logininfo
# ------------------------------------------------------------

CREATE TABLE `logininfo` (
  `id` bigint(20) NOT NULL,
  `CURFAILED` int(11) DEFAULT NULL,
  `TOTALFAILED` int(11) DEFAULT NULL,
  `SUCCESSDATE` datetime DEFAULT NULL,
  `PREVSUCCESSDATE` datetime DEFAULT NULL,
  `FAILEDDATE` datetime DEFAULT NULL,
  `USERNAME` varchar(255) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `USERNAME` (`USERNAME`),
  CONSTRAINT `FK_logininfo_USERNAME` FOREIGN KEY (`USERNAME`) REFERENCES `user_mapping` (`user_key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table NOTIFICATIONS
# ------------------------------------------------------------

CREATE TABLE `NOTIFICATIONS` (
  `NOTIFICATIONID` bigint(20) NOT NULL,
  `CONTENTID` bigint(20) DEFAULT NULL,
  `LABELID` bigint(20) DEFAULT NULL,
  `SPACEID` bigint(20) DEFAULT NULL,
  `USERNAME` varchar(255) NOT NULL,
  `CREATOR` varchar(255) DEFAULT NULL,
  `CREATIONDATE` datetime DEFAULT NULL,
  `LASTMODIFIER` varchar(255) DEFAULT NULL,
  `LASTMODDATE` datetime DEFAULT NULL,
  `DIGEST` bit(1) DEFAULT NULL,
  `NETWORK` bit(1) DEFAULT NULL,
  `CONTENTTYPE` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`NOTIFICATIONID`),
  KEY `n_labelid_idx` (`LABELID`),
  KEY `n_spaceid_idx` (`SPACEID`),
  KEY `n_contentid_idx` (`CONTENTID`),
  KEY `FK_NOTIFICATIONS_CREATOR` (`CREATOR`),
  KEY `FK_NOTIFICATIONS_USERNAME` (`USERNAME`),
  KEY `FK_NOTIFICATIONS_LASTMODIFIER` (`LASTMODIFIER`),
  CONSTRAINT `FK594ACC827072AEF` FOREIGN KEY (`LABELID`) REFERENCES `LABEL` (`LABELID`),
  CONSTRAINT `FK594ACC8B2DC6081` FOREIGN KEY (`SPACEID`) REFERENCES `SPACES` (`SPACEID`),
  CONSTRAINT `FK_NOTIFICATIONS_CONTENT` FOREIGN KEY (`CONTENTID`) REFERENCES `CONTENT` (`CONTENTID`),
  CONSTRAINT `FK_NOTIFICATIONS_CREATOR` FOREIGN KEY (`CREATOR`) REFERENCES `user_mapping` (`user_key`),
  CONSTRAINT `FK_NOTIFICATIONS_LASTMODIFIER` FOREIGN KEY (`LASTMODIFIER`) REFERENCES `user_mapping` (`user_key`),
  CONSTRAINT `FK_NOTIFICATIONS_USERNAME` FOREIGN KEY (`USERNAME`) REFERENCES `user_mapping` (`user_key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table os_group
# ------------------------------------------------------------

CREATE TABLE `os_group` (
  `id` bigint(20) NOT NULL,
  `groupname` varchar(255) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `groupname` (`groupname`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table OS_PROPERTYENTRY
# ------------------------------------------------------------

CREATE TABLE `OS_PROPERTYENTRY` (
  `entity_name` varchar(125) NOT NULL,
  `entity_id` bigint(20) NOT NULL,
  `entity_key` varchar(200) NOT NULL,
  `key_type` int(11) DEFAULT NULL,
  `boolean_val` bit(1) DEFAULT NULL,
  `double_val` double DEFAULT NULL,
  `string_val` varchar(255) DEFAULT NULL,
  `text_val` mediumtext,
  `long_val` bigint(20) DEFAULT NULL,
  `int_val` int(11) DEFAULT NULL,
  `date_val` datetime DEFAULT NULL,
  PRIMARY KEY (`entity_name`,`entity_id`,`entity_key`),
  KEY `ospe_entityid_idx` (`entity_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table os_user
# ------------------------------------------------------------

CREATE TABLE `os_user` (
  `id` bigint(20) NOT NULL,
  `username` varchar(255) NOT NULL,
  `passwd` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `username` (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table os_user_group
# ------------------------------------------------------------

CREATE TABLE `os_user_group` (
  `group_id` bigint(20) NOT NULL,
  `user_id` bigint(20) NOT NULL,
  PRIMARY KEY (`user_id`,`group_id`),
  KEY `c_groupdid_idx` (`group_id`),
  CONSTRAINT `FK932472461E2E76DB` FOREIGN KEY (`group_id`) REFERENCES `os_group` (`id`),
  CONSTRAINT `FK93247246F73AEE0F` FOREIGN KEY (`user_id`) REFERENCES `os_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table PAGETEMPLATES
# ------------------------------------------------------------

CREATE TABLE `PAGETEMPLATES` (
  `TEMPLATEID` bigint(20) NOT NULL,
  `TEMPLATENAME` varchar(255) NOT NULL,
  `TEMPLATEDESC` varchar(255) DEFAULT NULL,
  `PLUGINKEY` varchar(255) DEFAULT NULL,
  `MODULEKEY` varchar(255) DEFAULT NULL,
  `REFPLUGINKEY` varchar(255) DEFAULT NULL,
  `REFMODULEKEY` varchar(255) DEFAULT NULL,
  `CONTENT` mediumtext,
  `SPACEID` bigint(20) DEFAULT NULL,
  `PREVVER` bigint(20) DEFAULT NULL,
  `VERSION` int(11) NOT NULL,
  `CREATOR` varchar(255) DEFAULT NULL,
  `CREATIONDATE` datetime DEFAULT NULL,
  `LASTMODIFIER` varchar(255) DEFAULT NULL,
  `LASTMODDATE` datetime DEFAULT NULL,
  `BODYTYPEID` smallint(6) DEFAULT NULL,
  PRIMARY KEY (`TEMPLATEID`),
  KEY `pt_spaceid_idx` (`SPACEID`),
  KEY `pt_prevver_idx` (`PREVVER`),
  KEY `FK_PAGETEMPLATES_CREATOR` (`CREATOR`),
  KEY `FK_PAGETEMPLATES_LASTMODIFIER` (`LASTMODIFIER`),
  CONSTRAINT `FKBC7CE96A17D4A070` FOREIGN KEY (`PREVVER`) REFERENCES `PAGETEMPLATES` (`TEMPLATEID`),
  CONSTRAINT `FKBC7CE96AB2DC6081` FOREIGN KEY (`SPACEID`) REFERENCES `SPACES` (`SPACEID`),
  CONSTRAINT `FK_PAGETEMPLATES_CREATOR` FOREIGN KEY (`CREATOR`) REFERENCES `user_mapping` (`user_key`),
  CONSTRAINT `FK_PAGETEMPLATES_LASTMODIFIER` FOREIGN KEY (`LASTMODIFIER`) REFERENCES `user_mapping` (`user_key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table PLUGINDATA
# ------------------------------------------------------------

CREATE TABLE `PLUGINDATA` (
  `PLUGINDATAID` bigint(20) NOT NULL,
  `PLUGINKEY` varchar(255) NOT NULL,
  `FILENAME` varchar(255) NOT NULL,
  `LASTMODDATE` datetime DEFAULT NULL,
  `DATA` longblob,
  PRIMARY KEY (`PLUGINDATAID`),
  UNIQUE KEY `PLUGINKEY` (`PLUGINKEY`),
  UNIQUE KEY `FILENAME` (`FILENAME`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table remembermetoken
# ------------------------------------------------------------

CREATE TABLE `remembermetoken` (
  `id` bigint(20) NOT NULL,
  `username` varchar(255) NOT NULL,
  `created` bigint(20) NOT NULL,
  `token` varchar(255) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `rmt_username_idx` (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table SPACEGROUPPERMISSIONS
# ------------------------------------------------------------

CREATE TABLE `SPACEGROUPPERMISSIONS` (
  `SPACEGROUPPERMID` bigint(20) NOT NULL,
  `SPACEGROUPID` bigint(20) DEFAULT NULL,
  `PERMTYPE` varchar(255) NOT NULL,
  `PERMGROUPNAME` varchar(255) DEFAULT NULL,
  `PERMUSERNAME` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`SPACEGROUPPERMID`),
  KEY `sgp_type_idx` (`PERMTYPE`),
  KEY `sgp_group_idx` (`PERMGROUPNAME`),
  KEY `spg_id_idx` (`SPACEGROUPID`),
  KEY `FK_SPACEGROUPPERMISSIONS_PERMU` (`PERMUSERNAME`),
  CONSTRAINT `FK487D958B16994414` FOREIGN KEY (`SPACEGROUPID`) REFERENCES `SPACEGROUPS` (`SPACEGROUPID`),
  CONSTRAINT `FK_SPACEGROUPPERMISSIONS_PERMU` FOREIGN KEY (`PERMUSERNAME`) REFERENCES `user_mapping` (`user_key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table SPACEGROUPS
# ------------------------------------------------------------

CREATE TABLE `SPACEGROUPS` (
  `SPACEGROUPID` bigint(20) NOT NULL,
  `SPACEGROUPNAME` varchar(255) DEFAULT NULL,
  `SPACEGROUPKEY` varchar(255) NOT NULL,
  `LICENSEKEY` text,
  `CREATOR` varchar(255) DEFAULT NULL,
  `CREATIONDATE` datetime DEFAULT NULL,
  `LASTMODIFIER` varchar(255) DEFAULT NULL,
  `LASTMODDATE` datetime DEFAULT NULL,
  PRIMARY KEY (`SPACEGROUPID`),
  UNIQUE KEY `SPACEGROUPKEY` (`SPACEGROUPKEY`),
  KEY `FK_SPACEGROUPS_LASTMODIFIER` (`LASTMODIFIER`),
  KEY `FK_SPACEGROUPS_CREATOR` (`CREATOR`),
  CONSTRAINT `FK_SPACEGROUPS_CREATOR` FOREIGN KEY (`CREATOR`) REFERENCES `user_mapping` (`user_key`),
  CONSTRAINT `FK_SPACEGROUPS_LASTMODIFIER` FOREIGN KEY (`LASTMODIFIER`) REFERENCES `user_mapping` (`user_key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table SPACEPERMISSIONS
# ------------------------------------------------------------

CREATE TABLE `SPACEPERMISSIONS` (
  `PERMID` bigint(20) NOT NULL,
  `SPACEID` bigint(20) DEFAULT NULL,
  `PERMTYPE` varchar(255) NOT NULL,
  `PERMGROUPNAME` varchar(255) DEFAULT NULL,
  `PERMUSERNAME` varchar(255) DEFAULT NULL,
  `CREATOR` varchar(255) DEFAULT NULL,
  `CREATIONDATE` datetime DEFAULT NULL,
  `LASTMODIFIER` varchar(255) DEFAULT NULL,
  `LASTMODDATE` datetime DEFAULT NULL,
  PRIMARY KEY (`PERMID`),
  KEY `sp_comp_idx` (`PERMTYPE`,`PERMGROUPNAME`),
  KEY `sp_permtype_idx` (`PERMTYPE`),
  KEY `sp_spaceid_idx` (`SPACEID`),
  KEY `sp_pgname_idx` (`PERMGROUPNAME`),
  KEY `FK_SPACEPERMISSIONS_CREATOR` (`CREATOR`),
  KEY `FK_SPACEPERMISSIONS_PERMUSERNA` (`PERMUSERNAME`),
  KEY `FK_SPACEPERMISSIONS_LASTMODIFI` (`LASTMODIFIER`),
  CONSTRAINT `FKD33F23BEB2DC6081` FOREIGN KEY (`SPACEID`) REFERENCES `SPACES` (`SPACEID`),
  CONSTRAINT `FK_SPACEPERMISSIONS_CREATOR` FOREIGN KEY (`CREATOR`) REFERENCES `user_mapping` (`user_key`),
  CONSTRAINT `FK_SPACEPERMISSIONS_LASTMODIFI` FOREIGN KEY (`LASTMODIFIER`) REFERENCES `user_mapping` (`user_key`),
  CONSTRAINT `FK_SPACEPERMISSIONS_PERMUSERNA` FOREIGN KEY (`PERMUSERNAME`) REFERENCES `user_mapping` (`user_key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table SPACES
# ------------------------------------------------------------

CREATE TABLE `SPACES` (
  `SPACEID` bigint(20) NOT NULL,
  `SPACENAME` varchar(255) DEFAULT NULL,
  `SPACEKEY` varchar(255) NOT NULL,
  `SPACEDESCID` bigint(20) DEFAULT NULL,
  `HOMEPAGE` bigint(20) DEFAULT NULL,
  `CREATOR` varchar(255) DEFAULT NULL,
  `CREATIONDATE` datetime DEFAULT NULL,
  `LASTMODIFIER` varchar(255) DEFAULT NULL,
  `LASTMODDATE` datetime DEFAULT NULL,
  `SPACETYPE` varchar(255) DEFAULT NULL,
  `SPACESTATUS` varchar(255) DEFAULT NULL,
  `SPACEGROUPID` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`SPACEID`),
  UNIQUE KEY `SPACEKEY` (`SPACEKEY`),
  KEY `s_spacestatus_idx` (`SPACESTATUS`),
  KEY `s_spacegroupid_idx` (`SPACEGROUPID`),
  KEY `s_creationdate_idx` (`CREATIONDATE`),
  KEY `s_homepage_idx` (`HOMEPAGE`),
  KEY `s_spacedescid_idx` (`SPACEDESCID`),
  KEY `FK_SPACES_CREATOR` (`CREATOR`),
  KEY `FK_SPACES_LASTMODIFIER` (`LASTMODIFIER`),
  CONSTRAINT `FK9228242D11B7BFEE` FOREIGN KEY (`HOMEPAGE`) REFERENCES `CONTENT` (`CONTENTID`),
  CONSTRAINT `FK9228242D16994414` FOREIGN KEY (`SPACEGROUPID`) REFERENCES `SPACEGROUPS` (`SPACEGROUPID`),
  CONSTRAINT `FK9228242D2C72D3D2` FOREIGN KEY (`SPACEDESCID`) REFERENCES `CONTENT` (`CONTENTID`),
  CONSTRAINT `FK_SPACES_CREATOR` FOREIGN KEY (`CREATOR`) REFERENCES `user_mapping` (`user_key`),
  CONSTRAINT `FK_SPACES_LASTMODIFIER` FOREIGN KEY (`LASTMODIFIER`) REFERENCES `user_mapping` (`user_key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table TRACKBACKLINKS
# ------------------------------------------------------------

CREATE TABLE `TRACKBACKLINKS` (
  `LINKID` bigint(20) NOT NULL,
  `CONTENTTYPE` varchar(255) NOT NULL,
  `VIEWCOUNT` int(11) NOT NULL,
  `URL` varchar(255) NOT NULL,
  `TITLE` varchar(255) DEFAULT NULL,
  `BLOGNAME` varchar(255) DEFAULT NULL,
  `EXCERPT` varchar(255) DEFAULT NULL,
  `CONTENTID` bigint(20) NOT NULL,
  `CREATOR` varchar(255) DEFAULT NULL,
  `CREATIONDATE` datetime DEFAULT NULL,
  `LASTMODIFIER` varchar(255) DEFAULT NULL,
  `LASTMODDATE` datetime DEFAULT NULL,
  PRIMARY KEY (`LINKID`),
  KEY `tbl_contentid_idx` (`CONTENTID`),
  KEY `FK_TRACKBACKLINKS_CREATOR` (`CREATOR`),
  KEY `FK_TRACKBACKLINKS_LASTMODIFIER` (`LASTMODIFIER`),
  CONSTRAINT `FKF6977A478DD41734` FOREIGN KEY (`CONTENTID`) REFERENCES `CONTENT` (`CONTENTID`),
  CONSTRAINT `FK_TRACKBACKLINKS_CREATOR` FOREIGN KEY (`CREATOR`) REFERENCES `user_mapping` (`user_key`),
  CONSTRAINT `FK_TRACKBACKLINKS_LASTMODIFIER` FOREIGN KEY (`LASTMODIFIER`) REFERENCES `user_mapping` (`user_key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table TRUSTEDAPP
# ------------------------------------------------------------

CREATE TABLE `TRUSTEDAPP` (
  `TRUSTEDAPPID` bigint(20) NOT NULL,
  `NAME` varchar(255) NOT NULL,
  `TIMEOUT` int(11) NOT NULL,
  `PUBLIC_KEY_ID` bigint(20) NOT NULL,
  PRIMARY KEY (`TRUSTEDAPPID`),
  UNIQUE KEY `NAME` (`NAME`),
  UNIQUE KEY `PUBLIC_KEY_ID` (`PUBLIC_KEY_ID`),
  CONSTRAINT `FKDDB119CA9C85ADB1` FOREIGN KEY (`PUBLIC_KEY_ID`) REFERENCES `KEYSTORE` (`KEYID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table TRUSTEDAPPRESTRICTION
# ------------------------------------------------------------

CREATE TABLE `TRUSTEDAPPRESTRICTION` (
  `TRUSTEDAPPRESTRICTIONID` bigint(20) NOT NULL,
  `TYPE` varchar(32) NOT NULL,
  `restriction` varchar(255) DEFAULT NULL,
  `TRUSTEDAPPID` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`TRUSTEDAPPRESTRICTIONID`),
  KEY `c_trustedappid_idx` (`TRUSTEDAPPID`),
  CONSTRAINT `FKE8496BA235D1D865` FOREIGN KEY (`TRUSTEDAPPID`) REFERENCES `TRUSTEDAPP` (`TRUSTEDAPPID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table user_mapping
# ------------------------------------------------------------

CREATE TABLE `user_mapping` (
  `user_key` varchar(255) NOT NULL,
  `username` varchar(255) NOT NULL,
  `lower_username` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`user_key`),
  UNIQUE KEY `unq_lwr_username` (`lower_username`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;



# Dump of table users
# ------------------------------------------------------------

CREATE TABLE `users` (
  `id` bigint(20) NOT NULL,
  `name` varchar(255) NOT NULL,
  `password` varchar(255) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `created` datetime DEFAULT NULL,
  `fullname` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;




/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
