   ON DELETE CASCADE ON UPDATE CASCADE ;
 
 /********** TABLE METADATAGROUP-NODETYPE ***********/
-CREATE TABLE `RelMetadataGroupNodeType`(
-  `idRelMetadataGroupNodeType` int(12) unsigned NOT NULL AUTO_INCREMENT,
-  `idMetadataGroup` int(12) unsigned NOT NULL,
-  `idNodeType` int(12) unsigned NOT NULL,
-  PRIMARY KEY(`idRelMetadataGroupNodeType`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Relation between group and nodetype';
+CREATE TABLE `RelMetadataSectionNodeType`(
+  `idMetadataSection` int(12) unsigned NOT NULL,
+  `idNodeType` int(12) unsigned NOT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Relation between section and nodetype';
 
 -- UNIQUE
-ALTER TABLE `RelMetadataGroupNodeType` ADD UNIQUE(`idMetadataGroup`, `idNodeType`);
+ALTER TABLE `RelMetadataSectionNodeType` ADD UNIQUE(`idMetadataSection`, `idNodeType`);
 
 -- FOREIGN KEY
-ALTER TABLE `RelMetadataGroupNodeType` ADD FOREIGN KEY (`idMetadataGroup`) REFERENCES `MetadataGroup`(`idMetadataGroup`)
-  ON DELETE CASCADE ON UPDATE CASCADE ;
-ALTER TABLE `RelMetadataGroupNodeType` ADD FOREIGN KEY (`idNodeType`) REFERENCES `NodeTypes`(`IdNodeType`)
-  ON DELETE CASCADE ON UPDATE CASCADE ;
+ALTER TABLE `RelMetadataSectionNodeType` ADD FOREIGN KEY (`idMetadataSection`) REFERENCES
+  `MetadataSection`(`idMetadataSection`) ON DELETE CASCADE ON UPDATE CASCADE ;
+ALTER TABLE `RelMetadataSectionNodeType` ADD FOREIGN KEY (`idNodeType`) REFERENCES `NodeTypes`(`IdNodeType`)
+  ON DELETE CASCADE ON UPDATE CASCADE;
 
 /********** TABLE METADATA VALUE ***********/
 CREATE TABLE `MetadataValue`(


INSERT INTO `RelRolesActions` (`IdRol`, `IdAction`, `IdState`, `IdContext`, `IdPipeline`)
  VALUES  (201, 9510, 8, 1, 3), (201, 9510, 7, 1, 3);

-- UNIQUE
ALTER TABLE `Metadata` ADD UNIQUE(`name`);

/********** TABLE METADATASECTION ***********/
CREATE TABLE `MetadataSection`(
  `idMetadataSection` int(12) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  PRIMARY KEY(`idMetadataSection`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Available sections for metadata';

-- UNIQUE
ALTER TABLE `MetadataSection` ADD UNIQUE(`name`);

/********** TABLE METADATAGROUP ***********/
CREATE TABLE `MetadataGroup`(
  `idMetadataGroup` int(12) unsigned NOT NULL AUTO_INCREMENT,
  `idMetadataSection` int(12) unsigned,
  `name` varchar(255) NOT NULL,
  PRIMARY KEY(`idMetadataGroup`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Available groups for metadata';


-- FOREIGN KEY
ALTER TABLE `MetadataGroup` ADD FOREIGN KEY (`idMetadataSection`) REFERENCES
  `MetadataSection`(`idMetadataSection`) ON DELETE CASCADE ON UPDATE CASCADE ;

/********** TABLE METADATAGROUP-METADATA ***********/
CREATE TABLE `RelMetadataGroupMetadata`(
