CREATE TABLE `PATH_RESTRICTION_TEMPLATE` (
  `ID_INTERNAL` int(11) NOT NULL auto_increment,
  `KEY_ROOT_DOMAIN_OBJECT` int(11) NOT NULL default '1',
  `LABEL` VARCHAR(255) NOT NULL,
  `URL_PATH_REGEX` VARCHAR(500) NOT NULL,
  `WHY_MESSAGE` TEXT NOT NULL,
  `START` datetime default NULL,
  `END` datetime default NULL,
  `RESPONSIBLE_EMAIL` VARCHAR(500) NOT NULL,
  `RESPONSIBLE_AVAILABLE_FOR_CONTACT` TINYINT(1) NOT NULL default '0', 
  `CREATION_ENTITY` text,
  `CREATION_ENTITY_DATE` date default NULL,
  `UPDATE_ENTITY` text,
  `UPDATE_ENTITY_DATE` datetime default NULL,
  PRIMARY KEY  (`ID_INTERNAL`),
  KEY `KEY_ROOT_DOMAIN_OBJECT` (`KEY_ROOT_DOMAIN_OBJECT`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;


CREATE TABLE `PATH_RESTRICTION` (
  `ID_INTERNAL` int(11) NOT NULL auto_increment,
  `KEY_USER` int(11) NOT NULL,
  `KEY_PATH_RESTRICTION_TEMPLATE` int(11) NOT NULL,
  `UNLOCK_REQUEST` TEXT default NULL,
  `END` datetime default NULL,
  `END_JUSTIFICATION` TEXT default NULL,
  `CREATION_ENTITY` text,
  `CREATION_ENTITY_DATE` date default NULL,
  `UPDATE_ENTITY` text,
  `UPDATE_ENTITY_DATE` datetime default NULL,
  PRIMARY KEY  (`ID_INTERNAL`),
  KEY `KEY_USER` (`KEY_USER`),
  KEY `KEY_PATH_RESTRICTION_TEMPLATE` (`KEY_PATH_RESTRICTION_TEMPLATE`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;