--
-- Create content table that includes all information from subclasses
--

CREATE TABLE `CONTENT` (
  `ID_INTERNAL` INTEGER NOT NULL AUTO_INCREMENT,
  `OJB_CONCRETE_CLASS` VARCHAR(255) NOT NULL,
  `KEY_ROOT_DOMAIN_OBJECT` INTEGER NOT NULL DEFAULT '1',

  `CONTENT_ID` VARCHAR(255),
  
  `NAME` TEXT,
  `TITLE` TEXT,
  `BODY` LONGTEXT,
  `DESCRIPTION` TEXT,

  `MAXIMIZABLE` BOOLEAN,
  `GOOGLE_ANALYTICS_CODE` VARCHAR(255), 
  `KEY_CREATOR` INTEGER,
  `CREATION_DATE` DATETIME,
  `MODIFICATION_DATE` DATETIME,
  `PREFIX` VARCHAR(255),
  `KEY_INITIAL_CONTENT` INTEGER,
  `EXECUTION_PATH` VARCHAR(255),
  `ENABLED` BOOLEAN,
  `KEY_AVAILABILITY_POLICY` INTEGER,
  `KEY_META_DOMAIN_OBJECT` INTEGER, 
  `KEY_EXECUTION_PATH_VALUE` INTEGER,
 
  PRIMARY KEY (ID_INTERNAL),
  KEY `KEY_ROOT_DOMAIN_OBJECT` (`KEY_ROOT_DOMAIN_OBJECT`),
  KEY `KEY_INITIAL_CONTENT` (`KEY_INITIAL_CONTENT`),
  KEY `KEY_AVAILABILITY_POLICY` (`KEY_AVAILABILITY_POLICY`),
  KEY `KEY_META_DOMAIN_OBJECT` (`KEY_META_DOMAIN_OBJECT`),
  KEY `KEY_EXECUTION_PATH_VALUE` (`KEY_EXECUTION_PATH_VALUE`)
) TYPE=INNODB;

CREATE TABLE `NODE` (
  `ID_INTERNAL` INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `OJB_CONCRETE_CLASS` VARCHAR(255) NOT NULL,
  `KEY_ROOT_DOMAIN_OBJECT` INTEGER NOT NULL DEFAULT '1',
  `KEY_PARENT` INTEGER,
  `KEY_CHILD` INTEGER,
  `NODE_ORDER` INTEGER,
  `VISIBLE` BOOLEAN DEFAULT 1,
   KEY `KEY_ROOT_DOMAIN_OBJECT` (`KEY_ROOT_DOMAIN_OBJECT`)
) TYPE=INNODB;

