Index: build/DatabaseStructure.sql
===================================================================
diff -u -rbca00b0e437aeea92c5ef6fd0947ac64acf359cf -r0a615fd8fff795947585c1a7388a7cd205b6e57e
--- build/DatabaseStructure.sql	(.../DatabaseStructure.sql)	(revision bca00b0e437aeea92c5ef6fd0947ac64acf359cf)
+++ build/DatabaseStructure.sql	(.../DatabaseStructure.sql)	(revision 0a615fd8fff795947585c1a7388a7cd205b6e57e)
@@ -1,6 +1,6 @@
 /* ---------------------------------------------------- */
 /*  Generated by Enterprise Architect Version 12.0 		*/
-/*  Created On : 01-Feb-2018 15:56:25 				*/
+/*  Created On : 20-Mar-2018 14:36:05 				*/
 /*  DBMS       : SQLite 								*/
 /* ---------------------------------------------------- */
 
@@ -21,10 +21,10 @@
 DROP TABLE IF EXISTS 'AssessmentSectionEntity'
 ;
 
-DROP TABLE IF EXISTS 'MacroStabilityOutwardsFailureMechanismMetaEntity'
+DROP TABLE IF EXISTS 'FailureMechanismSectionEntity'
 ;
 
-DROP TABLE IF EXISTS 'FailureMechanismSectionEntity'
+DROP TABLE IF EXISTS 'MacroStabilityOutwardsFailureMechanismMetaEntity'
 ;
 
 DROP TABLE IF EXISTS 'FailureMechanismEntity'
@@ -51,27 +51,27 @@
 DROP TABLE IF EXISTS 'PipingCalculationEntity'
 ;
 
-DROP TABLE IF EXISTS 'GrassCoverErosionInwardsFailureMechanismMetaEntity'
-;
-
 DROP TABLE IF EXISTS 'StabilityPointStructuresFailureMechanismMetaEntity'
 ;
 
-DROP TABLE IF EXISTS 'GrassCoverErosionInwardsCalculationEntity'
+DROP TABLE IF EXISTS 'GrassCoverErosionInwardsFailureMechanismMetaEntity'
 ;
 
 DROP TABLE IF EXISTS 'DuneErosionFailureMechanismMetaEntity'
 ;
 
-DROP TABLE IF EXISTS 'GrassCoverErosionOutwardsFailureMechanismMetaEntity'
+DROP TABLE IF EXISTS 'GrassCoverErosionInwardsCalculationEntity'
 ;
 
-DROP TABLE IF EXISTS 'PipingSoilLayerEntity'
+DROP TABLE IF EXISTS 'GrassCoverErosionOutwardsFailureMechanismMetaEntity'
 ;
 
 DROP TABLE IF EXISTS 'HeightStructuresFailureMechanismMetaEntity'
 ;
 
+DROP TABLE IF EXISTS 'PipingSoilLayerEntity'
+;
+
 DROP TABLE IF EXISTS 'PipingSoilProfileEntity'
 ;
 
@@ -300,6 +300,12 @@
 DROP TABLE IF EXISTS 'HydraulicLocationCalculationEntity'
 ;
 
+DROP TABLE IF EXISTS 'HydraulicLocationCalculationCollectionToHydraulicCalculationEntity'
+;
+
+DROP TABLE IF EXISTS 'HydraulicLocationCalculationCollectionEntity'
+;
+
 /* Create Tables with Primary and Foreign Keys, Check and Unique Constraints */
 
 CREATE TABLE 'VersionEntity'
@@ -350,6 +356,14 @@
 (
 	'AssessmentSectionEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
 	'ProjectEntityId' INTEGER NOT NULL,
+	'HydraulicLocationCalculationCollectionEntity1Id' INTEGER NOT NULL,
+	'HydraulicLocationCalculationCollectionEntity2Id' INTEGER NOT NULL,
+	'HydraulicLocationCalculationCollectionEntity3Id' INTEGER NOT NULL,
+	'HydraulicLocationCalculationCollectionEntity4Id' INTEGER NOT NULL,
+	'HydraulicLocationCalculationCollectionEntity5Id' INTEGER NOT NULL,
+	'HydraulicLocationCalculationCollectionEntity6Id' INTEGER NOT NULL,
+	'HydraulicLocationCalculationCollectionEntity7Id' INTEGER NOT NULL,
+	'HydraulicLocationCalculationCollectionEntity8Id' INTEGER NOT NULL,
 	'Id' TEXT,
 	'Name' VARCHAR (260),
 	'Comments' TEXT,
@@ -361,19 +375,19 @@
 	'Composition' TINYINT (1) NOT NULL, -- Enum: 1 = Dike, 2 = Dune, 3 = DikeAndDune
 	'ReferenceLinePointXml' TEXT,
 	'Order' INT (4) NOT NULL,
-	CONSTRAINT 'FK_AssessmentSectionEntity_ProjectEntity' FOREIGN KEY ('ProjectEntityId') REFERENCES 'ProjectEntity' ('ProjectEntityId') ON DELETE Cascade ON UPDATE Cascade
+	CONSTRAINT 'FK_AssessmentSectionEntity_HydraulicLocationCalculationCollectionEntity' FOREIGN KEY ('HydraulicLocationCalculationCollectionEntity1Id') REFERENCES 'HydraulicLocationCalculationCollectionEntity' ('HydraulicLocationCalculationCollectionEntityId') ON DELETE No Action ON UPDATE Cascade,
+	CONSTRAINT 'FK_AssessmentSectionEntity_HydraulicLocationCalculationCollectionEntity_02' FOREIGN KEY ('HydraulicLocationCalculationCollectionEntity2Id') REFERENCES 'HydraulicLocationCalculationCollectionEntity' ('HydraulicLocationCalculationCollectionEntityId') ON DELETE No Action ON UPDATE Cascade,
+	CONSTRAINT 'FK_AssessmentSectionEntity_HydraulicLocationCalculationCollectionEntity_03' FOREIGN KEY ('HydraulicLocationCalculationCollectionEntity3Id') REFERENCES 'HydraulicLocationCalculationCollectionEntity' ('HydraulicLocationCalculationCollectionEntityId') ON DELETE No Action ON UPDATE Cascade,
+	CONSTRAINT 'FK_AssessmentSectionEntity_HydraulicLocationCalculationCollectionEntity_04' FOREIGN KEY ('HydraulicLocationCalculationCollectionEntity4Id') REFERENCES 'HydraulicLocationCalculationCollectionEntity' ('HydraulicLocationCalculationCollectionEntityId') ON DELETE No Action ON UPDATE Cascade,
+	CONSTRAINT 'FK_AssessmentSectionEntity_HydraulicLocationCalculationCollectionEntity_05' FOREIGN KEY ('HydraulicLocationCalculationCollectionEntity5Id') REFERENCES 'HydraulicLocationCalculationCollectionEntity' ('HydraulicLocationCalculationCollectionEntityId') ON DELETE No Action ON UPDATE Cascade,
+	CONSTRAINT 'FK_AssessmentSectionEntity_HydraulicLocationCalculationCollectionEntity_06' FOREIGN KEY ('HydraulicLocationCalculationCollectionEntity6Id') REFERENCES 'HydraulicLocationCalculationCollectionEntity' ('HydraulicLocationCalculationCollectionEntityId') ON DELETE No Action ON UPDATE Cascade,
+	CONSTRAINT 'FK_AssessmentSectionEntity_HydraulicLocationCalculationCollectionEntity_07' FOREIGN KEY ('HydraulicLocationCalculationCollectionEntity7Id') REFERENCES 'HydraulicLocationCalculationCollectionEntity' ('HydraulicLocationCalculationCollectionEntityId') ON DELETE No Action ON UPDATE Cascade,
+	CONSTRAINT 'FK_AssessmentSectionEntity_HydraulicLocationCalculationCollectionEntity_08' FOREIGN KEY ('HydraulicLocationCalculationCollectionEntity8Id') REFERENCES 'HydraulicLocationCalculationCollectionEntity' ('HydraulicLocationCalculationCollectionEntityId') ON DELETE No Action ON UPDATE Cascade,
+	CONSTRAINT 'FK_AssessmentSectionEntity_ProjectEntity' FOREIGN KEY ('ProjectEntityId') REFERENCES 'ProjectEntity' ('ProjectEntityId') ON DELETE Cascade ON UPDATE Cascade,
+	CONSTRAINT 'UQ_AssessmentSectionEntity_HydraulicLocationCalculationCollectionEntities' UNIQUE ('HydraulicLocationCalculationCollectionEntity1Id','HydraulicLocationCalculationCollectionEntity2Id','HydraulicLocationCalculationCollectionEntity3Id','HydraulicLocationCalculationCollectionEntity4Id','HydraulicLocationCalculationCollectionEntity5Id','HydraulicLocationCalculationCollectionEntity6Id','HydraulicLocationCalculationCollectionEntity7Id','HydraulicLocationCalculationCollectionEntity8Id')
 )
 ;
 
-CREATE TABLE 'MacroStabilityOutwardsFailureMechanismMetaEntity'
-(
-	'MacroStabilityOutwardsFailureMechanismMetaEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
-	'FailureMechanismEntityId' INTEGER NOT NULL,
-	'A' REAL NOT NULL,
-	CONSTRAINT 'FK_MacroStabilityOutwardsFailureMechanismMetaEntity_FailureMechanismEntity' FOREIGN KEY ('FailureMechanismEntityId') REFERENCES 'FailureMechanismEntity' ('FailureMechanismEntityId') ON DELETE Cascade ON UPDATE Cascade
-)
-;
-
 CREATE TABLE 'FailureMechanismSectionEntity'
 (
 	'FailureMechanismSectionEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
@@ -384,6 +398,15 @@
 )
 ;
 
+CREATE TABLE 'MacroStabilityOutwardsFailureMechanismMetaEntity'
+(
+	'MacroStabilityOutwardsFailureMechanismMetaEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
+	'FailureMechanismEntityId' INTEGER NOT NULL,
+	'A' REAL NOT NULL,
+	CONSTRAINT 'FK_MacroStabilityOutwardsFailureMechanismMetaEntity_FailureMechanismEntity' FOREIGN KEY ('FailureMechanismEntityId') REFERENCES 'FailureMechanismEntity' ('FailureMechanismEntityId') ON DELETE Cascade ON UPDATE Cascade
+)
+;
+
 CREATE TABLE 'FailureMechanismEntity'
 (
 	'FailureMechanismEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
@@ -520,36 +543,12 @@
 (
 	'HydraulicLocationEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
 	'AssessmentSectionEntityId' INTEGER NOT NULL,
-	'HydraulicLocationCalculationEntity1Id' INTEGER NOT NULL, -- Represents DesignWaterLevelCalculation1
-	'HydraulicLocationCalculationEntity2Id' INTEGER NOT NULL, -- Represents DesignWaterLevelCalculation2
-	'HydraulicLocationCalculationEntity3Id' INTEGER NOT NULL, -- Represents DesignWaterLevelCalculation3
-	'HydraulicLocationCalculationEntity4Id' INTEGER NOT NULL, -- Represents DesignWaterLevelCalculation4
-	'HydraulicLocationCalculationEntity5Id' INTEGER NOT NULL, -- Represents WaveHeightCalculation1
-	'HydraulicLocationCalculationEntity6Id' INTEGER NOT NULL, -- Represents WaveHeightCalculation2
-	'HydraulicLocationCalculationEntity7Id' INTEGER NOT NULL, -- Represents WaveHeightCalculation3
-	'HydraulicLocationCalculationEntity8Id' INTEGER NOT NULL, -- Represents WaveHeightCalculation4
 	'LocationId' INTEGER NOT NULL,
 	'Name' VARCHAR (260) NOT NULL,
 	'LocationX' REAL,
 	'LocationY' REAL,
 	'Order' INT (4) NOT NULL,
-	CONSTRAINT 'FK_HydraulicLocationEntity_AssessmentSectionEntity' FOREIGN KEY ('AssessmentSectionEntityId') REFERENCES 'AssessmentSectionEntity' ('AssessmentSectionEntityId') ON DELETE Cascade ON UPDATE Cascade,
-	CONSTRAINT 'FK_HydraulicLocationEntity_HydraulicLocationCalculationEntity1' FOREIGN KEY ('HydraulicLocationCalculationEntity1Id') REFERENCES 'HydraulicLocationCalculationEntity' ('HydraulicLocationCalculationEntityId') ON DELETE No Action ON UPDATE Cascade,
-	CONSTRAINT 'FK_HydraulicLocationEntity_HydraulicLocationCalculationEntity2' FOREIGN KEY ('HydraulicLocationCalculationEntity2Id') REFERENCES 'HydraulicLocationCalculationEntity' ('HydraulicLocationCalculationEntityId') ON DELETE No Action ON UPDATE Cascade,
-	CONSTRAINT 'FK_HydraulicLocationEntity_HydraulicLocationCalculationEntity3' FOREIGN KEY ('HydraulicLocationCalculationEntity3Id') REFERENCES 'HydraulicLocationCalculationEntity' ('HydraulicLocationCalculationEntityId') ON DELETE No Action ON UPDATE Cascade,
-	CONSTRAINT 'FK_HydraulicLocationEntity_HydraulicLocationCalculationEntity4' FOREIGN KEY ('HydraulicLocationCalculationEntity4Id') REFERENCES 'HydraulicLocationCalculationEntity' ('HydraulicLocationCalculationEntityId') ON DELETE No Action ON UPDATE Cascade,
-	CONSTRAINT 'FK_HydraulicLocationEntity_HydraulicLocationCalculationEntity5' FOREIGN KEY ('HydraulicLocationCalculationEntity5Id') REFERENCES 'HydraulicLocationCalculationEntity' ('HydraulicLocationCalculationEntityId') ON DELETE No Action ON UPDATE Cascade,
-	CONSTRAINT 'FK_HydraulicLocationEntity_HydraulicLocationCalculationEntity6' FOREIGN KEY ('HydraulicLocationCalculationEntity6Id') REFERENCES 'HydraulicLocationCalculationEntity' ('HydraulicLocationCalculationEntityId') ON DELETE No Action ON UPDATE Cascade,
-	CONSTRAINT 'FK_HydraulicLocationEntity_HydraulicLocationCalculationEntity7' FOREIGN KEY ('HydraulicLocationCalculationEntity7Id') REFERENCES 'HydraulicLocationCalculationEntity' ('HydraulicLocationCalculationEntityId') ON DELETE No Action ON UPDATE Cascade,
-	CONSTRAINT 'FK_HydraulicLocationEntity_HydraulicLocationCalculationEntity8' FOREIGN KEY ('HydraulicLocationCalculationEntity8Id') REFERENCES 'HydraulicLocationCalculationEntity' ('HydraulicLocationCalculationEntityId') ON DELETE No Action ON UPDATE Cascade,
-	CONSTRAINT 'U_HydraulicLocationCalculationEntity_HydraulicLocationCalculationEntity2Id' UNIQUE ('HydraulicLocationCalculationEntity2Id'),
-	CONSTRAINT 'U_HydraulicLocationCalculationEntity_HydraulicLocationCalculationEntity4Id' UNIQUE ('HydraulicLocationCalculationEntity4Id'),
-	CONSTRAINT 'U_HydraulicLocationCalculationEntity_HydraulicLocationCalculationEntity3Id' UNIQUE ('HydraulicLocationCalculationEntity3Id'),
-	CONSTRAINT 'U_HydraulicLocationCalculationEntity_HydraulicLocationCalculationEntity1Id' UNIQUE ('HydraulicLocationCalculationEntity1Id'),
-	CONSTRAINT 'U_HydraulicLocationCalculationEntity_HydraulicLocationCalculationEntity6Id' UNIQUE ('HydraulicLocationCalculationEntity6Id'),
-	CONSTRAINT 'U_HydraulicLocationCalculationEntity_HydraulicLocationCalculationEntity8Id' UNIQUE ('HydraulicLocationCalculationEntity8Id'),
-	CONSTRAINT 'U_HydraulicLocationCalculationEntity_HydraulicLocationCalculationEntity7Id' UNIQUE ('HydraulicLocationCalculationEntity7Id'),
-	CONSTRAINT 'U_HydraulicLocationCalculationEntity_HydraulicLocationCalculationEntity5Id' UNIQUE ('HydraulicLocationCalculationEntity5Id')
+	CONSTRAINT 'FK_HydraulicLocationEntity_AssessmentSectionEntity' FOREIGN KEY ('AssessmentSectionEntityId') REFERENCES 'AssessmentSectionEntity' ('AssessmentSectionEntityId') ON DELETE Cascade ON UPDATE Cascade
 )
 ;
 
@@ -580,6 +579,17 @@
 )
 ;
 
+CREATE TABLE 'StabilityPointStructuresFailureMechanismMetaEntity'
+(
+	'StabilityPointStructuresFailureMechanismMetaEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
+	'FailureMechanismEntityId' INTEGER NOT NULL,
+	'N' REAL NOT NULL,
+	'ForeshoreProfileCollectionSourcePath' TEXT,
+	'StabilityPointStructureCollectionSourcePath' TEXT,
+	CONSTRAINT 'FK_StrengthStabilityPointConstructionFailureMechanismMetaEntity_FailureMechanismEntity' FOREIGN KEY ('FailureMechanismEntityId') REFERENCES 'FailureMechanismEntity' ('FailureMechanismEntityId') ON DELETE Cascade ON UPDATE Cascade
+)
+;
+
 CREATE TABLE 'GrassCoverErosionInwardsFailureMechanismMetaEntity'
 (
 	'GrassCoverErosionInwardsFailureMechanismMetaEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
@@ -590,14 +600,12 @@
 )
 ;
 
-CREATE TABLE 'StabilityPointStructuresFailureMechanismMetaEntity'
+CREATE TABLE 'DuneErosionFailureMechanismMetaEntity'
 (
-	'StabilityPointStructuresFailureMechanismMetaEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
+	'DuneErosionFailureMechanismMetaEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
 	'FailureMechanismEntityId' INTEGER NOT NULL,
 	'N' REAL NOT NULL,
-	'ForeshoreProfileCollectionSourcePath' TEXT,
-	'StabilityPointStructureCollectionSourcePath' TEXT,
-	CONSTRAINT 'FK_StrengthStabilityPointConstructionFailureMechanismMetaEntity_FailureMechanismEntity' FOREIGN KEY ('FailureMechanismEntityId') REFERENCES 'FailureMechanismEntity' ('FailureMechanismEntityId') ON DELETE Cascade ON UPDATE Cascade
+	CONSTRAINT 'FK_DuneErosionFailureMechanismMetaEntity_FailureMechanismEntity' FOREIGN KEY ('FailureMechanismEntityId') REFERENCES 'FailureMechanismEntity' ('FailureMechanismEntityId') ON DELETE Cascade ON UPDATE Cascade
 )
 ;
 
@@ -629,22 +637,24 @@
 )
 ;
 
-CREATE TABLE 'DuneErosionFailureMechanismMetaEntity'
+CREATE TABLE 'GrassCoverErosionOutwardsFailureMechanismMetaEntity'
 (
-	'DuneErosionFailureMechanismMetaEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
+	'GrassCoverErosionOutwardsFailureMechanismMetaEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
 	'FailureMechanismEntityId' INTEGER NOT NULL,
 	'N' REAL NOT NULL,
-	CONSTRAINT 'FK_DuneErosionFailureMechanismMetaEntity_FailureMechanismEntity' FOREIGN KEY ('FailureMechanismEntityId') REFERENCES 'FailureMechanismEntity' ('FailureMechanismEntityId') ON DELETE Cascade ON UPDATE Cascade
+	'ForeshoreProfileCollectionSourcePath' TEXT,
+	CONSTRAINT 'FK_GrassCoverErosionOutwardsFailureMechanismMetaEntity_FailureMechanismEntity' FOREIGN KEY ('FailureMechanismEntityId') REFERENCES 'FailureMechanismEntity' ('FailureMechanismEntityId') ON DELETE Cascade ON UPDATE Cascade
 )
 ;
 
-CREATE TABLE 'GrassCoverErosionOutwardsFailureMechanismMetaEntity'
+CREATE TABLE 'HeightStructuresFailureMechanismMetaEntity'
 (
-	'GrassCoverErosionOutwardsFailureMechanismMetaEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
+	'HeightStructuresFailureMechanismMetaEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
 	'FailureMechanismEntityId' INTEGER NOT NULL,
 	'N' REAL NOT NULL,
+	'HeightStructureCollectionSourcePath' TEXT,
 	'ForeshoreProfileCollectionSourcePath' TEXT,
-	CONSTRAINT 'FK_GrassCoverErosionOutwardsFailureMechanismMetaEntity_FailureMechanismEntity' FOREIGN KEY ('FailureMechanismEntityId') REFERENCES 'FailureMechanismEntity' ('FailureMechanismEntityId') ON DELETE Cascade ON UPDATE Cascade
+	CONSTRAINT 'FK_HeightStructuresFailureMechanismMetaEntity_FailureMechanismEntity' FOREIGN KEY ('FailureMechanismEntityId') REFERENCES 'FailureMechanismEntity' ('FailureMechanismEntityId') ON DELETE Cascade ON UPDATE Cascade
 )
 ;
 
@@ -668,17 +678,6 @@
 )
 ;
 
-CREATE TABLE 'HeightStructuresFailureMechanismMetaEntity'
-(
-	'HeightStructuresFailureMechanismMetaEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
-	'FailureMechanismEntityId' INTEGER NOT NULL,
-	'N' REAL NOT NULL,
-	'HeightStructureCollectionSourcePath' TEXT,
-	'ForeshoreProfileCollectionSourcePath' TEXT,
-	CONSTRAINT 'FK_HeightStructuresFailureMechanismMetaEntity_FailureMechanismEntity' FOREIGN KEY ('FailureMechanismEntityId') REFERENCES 'FailureMechanismEntity' ('FailureMechanismEntityId') ON DELETE Cascade ON UPDATE Cascade
-)
-;
-
 CREATE TABLE 'PipingSoilProfileEntity'
 (
 	'PipingSoilProfileEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
@@ -1932,10 +1931,28 @@
 CREATE TABLE 'HydraulicLocationCalculationEntity'
 (
 	'HydraulicLocationCalculationEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
-	'ShouldIllustrationPointsBeCalculated' TINYINT (1) NOT NULL -- True or false
+	'HydraulicLocationEntityId' INTEGER NOT NULL,
+	'ShouldIllustrationPointsBeCalculated' TINYINT (1) NOT NULL, -- True or false
+	CONSTRAINT 'FK_HydraulicLocationCalculationEntity_HydraulicLocationEntity' FOREIGN KEY ('HydraulicLocationEntityId') REFERENCES 'HydraulicLocationEntity' ('HydraulicLocationEntityId') ON DELETE Cascade ON UPDATE Cascade
 )
 ;
 
+CREATE TABLE 'HydraulicLocationCalculationCollectionToHydraulicCalculationEntity'
+(
+	'HydraulicLocationCalculationEntityId' INTEGER NOT NULL,
+	'HydraulicLocationCalculationCollectionEntityId' INTEGER NOT NULL,
+	CONSTRAINT 'PK_HydraulicLocationCalculationCollectionToHydraulicCalculationEntity' PRIMARY KEY ('HydraulicLocationCalculationEntityId','HydraulicLocationCalculationCollectionEntityId'),
+	CONSTRAINT 'FK_HydraulicLocationCalculationCollectionToHydraulicCalculationEntity_HydraulicLocationCalculationCollectionEntity' FOREIGN KEY ('HydraulicLocationCalculationCollectionEntityId') REFERENCES 'HydraulicLocationCalculationCollectionEntity' ('HydraulicLocationCalculationCollectionEntityId') ON DELETE Cascade ON UPDATE Cascade,
+	CONSTRAINT 'FK_HydraulicLocationCalculationCollectionToHydraulicCalculationEntity_HydraulicLocationCalculationEntity' FOREIGN KEY ('HydraulicLocationCalculationEntityId') REFERENCES 'HydraulicLocationCalculationEntity' ('HydraulicLocationCalculationEntityId') ON DELETE Cascade ON UPDATE Cascade
+)
+;
+
+CREATE TABLE 'HydraulicLocationCalculationCollectionEntity'
+(
+	'HydraulicLocationCalculationCollectionEntityId' INTEGER NOT NULL PRIMARY KEY
+)
+;
+
 /* Create Indexes and Triggers */
 
 CREATE INDEX 'IXFK_GrassCoverErosionInwardsDikeHeightOutputEntity_GeneralResultFaultTreeIllustrationPointEntity'
@@ -1961,18 +1978,67 @@
  ON 'MacroStabilityInwardsFailureMechanismMetaEntity' ('FailureMechanismEntityId' ASC)
 ;
 
+CREATE INDEX 'IXFK_AssessmentSectionEntity_HydraulicLocationCalculationCollectionEntity'
+ ON 'AssessmentSectionEntity' ('HydraulicLocationCalculationCollectionEntity1Id' ASC)
+;
+
+CREATE INDEX 'IXFK_AssessmentSectionEntity_HydraulicLocationCalculationCollectionEntity_02'
+ ON 'AssessmentSectionEntity' ('HydraulicLocationCalculationCollectionEntity2Id' ASC)
+;
+
+CREATE INDEX 'IXFK_AssessmentSectionEntity_HydraulicLocationCalculationCollectionEntity_03'
+ ON 'AssessmentSectionEntity' ('HydraulicLocationCalculationCollectionEntity3Id' ASC)
+;
+
+CREATE INDEX 'IXFK_AssessmentSectionEntity_HydraulicLocationCalculationCollectionEntity_04'
+ ON 'AssessmentSectionEntity' ('HydraulicLocationCalculationCollectionEntity4Id' ASC)
+;
+
+CREATE INDEX 'IXFK_AssessmentSectionEntity_HydraulicLocationCalculationCollectionEntity_05'
+ ON 'AssessmentSectionEntity' ('HydraulicLocationCalculationCollectionEntity5Id' ASC)
+;
+
+CREATE INDEX 'IXFK_AssessmentSectionEntity_HydraulicLocationCalculationCollectionEntity_06'
+ ON 'AssessmentSectionEntity' ('HydraulicLocationCalculationCollectionEntity6Id' ASC)
+;
+
+CREATE INDEX 'IXFK_AssessmentSectionEntity_HydraulicLocationCalculationCollectionEntity_07'
+ ON 'AssessmentSectionEntity' ('HydraulicLocationCalculationCollectionEntity7Id' ASC)
+;
+
+CREATE INDEX 'IXFK_AssessmentSectionEntity_HydraulicLocationCalculationCollectionEntity_08'
+ ON 'AssessmentSectionEntity' ('HydraulicLocationCalculationCollectionEntity8Id' ASC)
+;
+
 CREATE INDEX 'IXFK_AssessmentSectionEntity_ProjectEntity'
  ON 'AssessmentSectionEntity' ('ProjectEntityId' ASC)
 ;
-
-CREATE INDEX 'IXFK_MacroStabilityOutwardsFailureMechanismMetaEntity_FailureMechanismEntity'
- ON 'MacroStabilityOutwardsFailureMechanismMetaEntity' ('FailureMechanismEntityId' ASC)
+CREATE TRIGGER [TR_AfterDeleteAssessmentSectionEntity_RemoveHydraulicLocationCalculationCollectionEntities]
+	AFTER DELETE
+	ON AssessmentSectionEntity
+	FOR EACH ROW
+BEGIN
+	DELETE 
+	FROM HydraulicLocationCalculationCollectionEntity
+	WHERE HydraulicLocationCalculationCollectionEntityId IS OLD.HydraulicLocationCalculationCollectionEntity1Id
+	OR HydraulicLocationCalculationCollectionEntityId IS OLD.HydraulicLocationCalculationCollectionEntity2Id
+	OR HydraulicLocationCalculationCollectionEntityId IS OLD.HydraulicLocationCalculationCollectionEntity3Id
+	OR HydraulicLocationCalculationCollectionEntityId IS OLD.HydraulicLocationCalculationCollectionEntity4Id
+	OR HydraulicLocationCalculationCollectionEntityId IS OLD.HydraulicLocationCalculationCollectionEntity5Id
+	OR HydraulicLocationCalculationCollectionEntityId IS OLD.HydraulicLocationCalculationCollectionEntity6Id
+	OR HydraulicLocationCalculationCollectionEntityId IS OLD.HydraulicLocationCalculationCollectionEntity7Id
+	OR HydraulicLocationCalculationCollectionEntityId IS OLD.HydraulicLocationCalculationCollectionEntity8Id;
+END; 
 ;
 
 CREATE INDEX 'IXFK_FailureMechanismSectionEntity_FailureMechanismEntity'
  ON 'FailureMechanismSectionEntity' ('FailureMechanismEntityId' ASC)
 ;
 
+CREATE INDEX 'IXFK_MacroStabilityOutwardsFailureMechanismMetaEntity_FailureMechanismEntity'
+ ON 'MacroStabilityOutwardsFailureMechanismMetaEntity' ('FailureMechanismEntityId' ASC)
+;
+
 CREATE INDEX 'IXFK_FailureMechanismEntity_AssessmentSectionEntity'
  ON 'FailureMechanismEntity' ('AssessmentSectionEntityId' ASC)
 ;
@@ -2017,133 +2083,6 @@
  ON 'HydraulicLocationEntity' ('AssessmentSectionEntityId' ASC)
 ;
 
-CREATE INDEX 'IXFK_HydraulicLocationEntity_HydraulicLocationCalculationEntity'
- ON 'HydraulicLocationEntity' ('HydraulicLocationCalculationEntity1Id' ASC)
-;
-
-CREATE INDEX 'IXFK_HydraulicLocationEntity_HydraulicLocationCalculationEntity_02'
- ON 'HydraulicLocationEntity' ('HydraulicLocationCalculationEntity2Id' ASC)
-;
-
-CREATE INDEX 'IXFK_HydraulicLocationEntity_HydraulicLocationCalculationEntity_03'
- ON 'HydraulicLocationEntity' ('HydraulicLocationCalculationEntity3Id' ASC)
-;
-
-CREATE INDEX 'IXFK_HydraulicLocationEntity_HydraulicLocationCalculationEntity_04'
- ON 'HydraulicLocationEntity' ('HydraulicLocationCalculationEntity4Id' ASC)
-;
-
-CREATE INDEX 'IXFK_HydraulicLocationEntity_HydraulicLocationCalculationEntity_05'
- ON 'HydraulicLocationEntity' ('HydraulicLocationCalculationEntity5Id' ASC)
-;
-
-CREATE INDEX 'IXFK_HydraulicLocationEntity_HydraulicLocationCalculationEntity_06'
- ON 'HydraulicLocationEntity' ('HydraulicLocationCalculationEntity6Id' ASC)
-;
-
-CREATE INDEX 'IXFK_HydraulicLocationEntity_HydraulicLocationCalculationEntity_07'
- ON 'HydraulicLocationEntity' ('HydraulicLocationCalculationEntity7Id' ASC)
-;
-
-CREATE INDEX 'IXFK_HydraulicLocationEntity_HydraulicLocationCalculationEntity_08'
- ON 'HydraulicLocationEntity' ('HydraulicLocationCalculationEntity8Id' ASC)
-;
-CREATE TRIGGER [TR_AfterDeleteHydraulicLocationEntity_RemoveHydraulicLocationCalculationEntity_CalculationEntity2]
-	AFTER DELETE
-	ON HydraulicLocationEntity
-	FOR EACH ROW
-BEGIN
-	DELETE 
-	FROM HydraulicLocationCalculationEntity
-	WHERE OLD.HydraulicLocationCalculationEntity1Id IS NOT NULL 
-	AND HydraulicLocationCalculationEntityId IS OLD.HydraulicLocationCalculationEntity2Id;
-END; 
-;
-
-CREATE TRIGGER [TR_AfterDeleteHydraulicLocationEntity_RemoveHydraulicLocationCalculationEntity_CalculationEntity4]
-	AFTER DELETE
-	ON HydraulicLocationEntity
-	FOR EACH ROW
-BEGIN
-	DELETE 
-	FROM HydraulicLocationCalculationEntity
-	WHERE OLD.HydraulicLocationCalculationEntity1Id IS NOT NULL 
-	AND HydraulicLocationCalculationEntityId IS OLD.HydraulicLocationCalculationEntity4Id;
-END; 
-;
-
-CREATE TRIGGER [TR_AfterDeleteHydraulicLocationEntity_RemoveHydraulicLocationCalculationEntity_CalculationEntity3]
-	AFTER DELETE
-	ON HydraulicLocationEntity
-	FOR EACH ROW
-BEGIN
-	DELETE 
-	FROM HydraulicLocationCalculationEntity
-	WHERE OLD.HydraulicLocationCalculationEntity1Id IS NOT NULL 
-	AND HydraulicLocationCalculationEntityId IS OLD.HydraulicLocationCalculationEntity3Id;
-END; 
-;
-
-CREATE TRIGGER [TR_AfterDeleteHydraulicLocationEntity_RemoveHydraulicLocationCalculationEntity_CalculationEntity1]
-	AFTER DELETE
-	ON HydraulicLocationEntity
-	FOR EACH ROW
-BEGIN
-	DELETE 
-	FROM HydraulicLocationCalculationEntity
-	WHERE OLD.HydraulicLocationCalculationEntity1Id IS NOT NULL 
-	AND HydraulicLocationCalculationEntityId IS OLD.HydraulicLocationCalculationEntity1Id;
-END; 
-;
-
-CREATE TRIGGER [TR_AfterDeleteHydraulicLocationEntity_RemoveHydraulicLocationCalculationEntity_CalculationEntity6]
-	AFTER DELETE
-	ON HydraulicLocationEntity
-	FOR EACH ROW
-BEGIN
-	DELETE 
-	FROM HydraulicLocationCalculationEntity
-	WHERE OLD.HydraulicLocationCalculationEntity1Id IS NOT NULL 
-	AND HydraulicLocationCalculationEntityId IS OLD.HydraulicLocationCalculationEntity6Id;
-END; 
-;
-
-CREATE TRIGGER [TR_AfterDeleteHydraulicLocationEntity_RemoveHydraulicLocationCalculationEntity_CalculationEntity8]
-	AFTER DELETE
-	ON HydraulicLocationEntity
-	FOR EACH ROW
-BEGIN
-	DELETE 
-	FROM HydraulicLocationCalculationEntity
-	WHERE OLD.HydraulicLocationCalculationEntity1Id IS NOT NULL 
-	AND HydraulicLocationCalculationEntityId IS OLD.HydraulicLocationCalculationEntity8Id;
-END; 
-;
-
-CREATE TRIGGER [TR_AfterDeleteHydraulicLocationEntity_RemoveHydraulicLocationCalculationEntity_CalculationEntity7]
-	AFTER DELETE
-	ON HydraulicLocationEntity
-	FOR EACH ROW
-BEGIN
-	DELETE 
-	FROM HydraulicLocationCalculationEntity
-	WHERE OLD.HydraulicLocationCalculationEntity1Id IS NOT NULL 
-	AND HydraulicLocationCalculationEntityId IS OLD.HydraulicLocationCalculationEntity7Id;
-END; 
-;
-
-CREATE TRIGGER [TR_AfterDeleteHydraulicLocationEntity_RemoveHydraulicLocationCalculationEntity_CalculationEntity5]
-	AFTER DELETE
-	ON HydraulicLocationEntity
-	FOR EACH ROW
-BEGIN
-	DELETE 
-	FROM HydraulicLocationCalculationEntity
-	WHERE OLD.HydraulicLocationCalculationEntity1Id IS NOT NULL 
-	AND HydraulicLocationCalculationEntityId IS OLD.HydraulicLocationCalculationEntity5Id;
-END; 
-;
-
 CREATE INDEX 'IXFK_PipingCalculationEntity_PipingStochasticSoilProfileEntity'
  ON 'PipingCalculationEntity' ('PipingStochasticSoilProfileEntityId' ASC)
 ;
@@ -2160,12 +2099,16 @@
  ON 'PipingCalculationEntity' ('CalculationGroupEntityId' ASC)
 ;
 
+CREATE INDEX 'IXFK_StrengthStabilityPointConstructionFailureMechanismMetaEntity_FailureMechanismEntity'
+ ON 'StabilityPointStructuresFailureMechanismMetaEntity' ('FailureMechanismEntityId' ASC)
+;
+
 CREATE INDEX 'IXFK_GrassCoverErosionInwardsFailureMechanismMetaEntity_FailureMechanismEntity'
  ON 'GrassCoverErosionInwardsFailureMechanismMetaEntity' ('FailureMechanismEntityId' ASC)
 ;
 
-CREATE INDEX 'IXFK_StrengthStabilityPointConstructionFailureMechanismMetaEntity_FailureMechanismEntity'
- ON 'StabilityPointStructuresFailureMechanismMetaEntity' ('FailureMechanismEntityId' ASC)
+CREATE INDEX 'IXFK_DuneErosionFailureMechanismMetaEntity_FailureMechanismEntity'
+ ON 'DuneErosionFailureMechanismMetaEntity' ('FailureMechanismEntityId' ASC)
 ;
 
 CREATE INDEX 'IXFK_GrassCoverErosionInwardsCalculationEntity_CalculationGroupEntity'
@@ -2180,10 +2123,6 @@
  ON 'GrassCoverErosionInwardsCalculationEntity' ('HydraulicLocationEntityId' ASC)
 ;
 
-CREATE INDEX 'IXFK_DuneErosionFailureMechanismMetaEntity_FailureMechanismEntity'
- ON 'DuneErosionFailureMechanismMetaEntity' ('FailureMechanismEntityId' ASC)
-;
-
 CREATE INDEX 'IXFK_GrassCoverErosionOutwardsFailureMechanismMetaEntity_FailureMechanismEntity'
  ON 'GrassCoverErosionOutwardsFailureMechanismMetaEntity' ('FailureMechanismEntityId' ASC)
 ;
@@ -2757,3 +2696,26 @@
 CREATE INDEX 'IXFK_HydraRingPreprocessorEntity_AssessmentSectionEntity'
  ON 'HydraRingPreprocessorEntity' ('AssessmentSectionEntityId' ASC)
 ;
+
+CREATE INDEX 'IXFK_HydraulicLocationCalculationEntity_HydraulicLocationEntity'
+ ON 'HydraulicLocationCalculationEntity' ('HydraulicLocationEntityId' ASC)
+;
+
+CREATE INDEX 'IXFK_HydraulicLocationCalculationCollectionToHydraulicCalculationEntity_HydraulicLocationCalculationCollectionEntity'
+ ON 'HydraulicLocationCalculationCollectionToHydraulicCalculationEntity' ('HydraulicLocationCalculationCollectionEntityId' ASC)
+;
+
+CREATE INDEX 'IXFK_HydraulicLocationCalculationCollectionToHydraulicCalculationEntity_HydraulicLocationCalculationEntity'
+ ON 'HydraulicLocationCalculationCollectionToHydraulicCalculationEntity' ('HydraulicLocationCalculationEntityId' ASC)
+;
+CREATE TRIGGER [TR_AfterDeleteHydraulicLocationCalculationCollectionEntity_RemoveHydraulicLocationCalculationEntity]
+	AFTER DELETE
+	ON HydraulicLocationCalculationCollectionEntity
+	FOR EACH ROW
+BEGIN
+	DELETE 
+	FROM HydraulicLocationCalculationEntity
+	WHERE OLD.HydraulicLocationCalculationEntityId IS NOT NULL 
+	AND HydraulicLocationCalculationEntityId IS OLD.HydraulicLocationCalculationEntityId;
+END; 
+;
