Index: build/DatabaseStructure.sql
===================================================================
diff -u -r899d227631395ebeb5154719f7b92a42ddbc6f96 -r3dbf451144dc23d8abe649913baee1a5e544c48c
--- build/DatabaseStructure.sql	(.../DatabaseStructure.sql)	(revision 899d227631395ebeb5154719f7b92a42ddbc6f96)
+++ build/DatabaseStructure.sql	(.../DatabaseStructure.sql)	(revision 3dbf451144dc23d8abe649913baee1a5e544c48c)
@@ -1,6 +1,6 @@
 /* ---------------------------------------------------- */
 /*  Generated by Enterprise Architect Version 12.0 		*/
-/*  Created On : 29-jan-2018 11:07:03 				*/
+/*  Created On : 30-Jan-2018 14:00:08 				*/
 /*  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'
 ;
 
@@ -303,6 +303,9 @@
 DROP TABLE IF EXISTS 'HydraRingPreprocessorEntity'
 ;
 
+DROP TABLE IF EXISTS 'HydraulicLocationCalculationEntity'
+;
+
 /* Create Tables with Primary and Foreign Keys, Check and Unique Constraints */
 
 CREATE TABLE 'VersionEntity'
@@ -368,15 +371,6 @@
 )
 ;
 
-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,
@@ -387,6 +381,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,
@@ -523,14 +526,36 @@
 (
 	'HydraulicLocationEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
 	'AssessmentSectionEntityId' INTEGER NOT NULL,
+	'HydraulicLocationCalculationEntity1Id' INTEGER NOT NULL,
+	'HydraulicLocationCalculationEntity2Id' INTEGER NOT NULL,
+	'HydraulicLocationCalculationEntity3Id' INTEGER NOT NULL,
+	'HydraulicLocationCalculationEntity4Id' INTEGER NOT NULL,
+	'HydraulicLocationCalculationEntity5Id' INTEGER NOT NULL,
+	'HydraulicLocationCalculationEntity6Id' INTEGER NOT NULL,
+	'HydraulicLocationCalculationEntity7Id' INTEGER NOT NULL,
+	'HydraulicLocationCalculationEntity8Id' INTEGER NOT NULL,
 	'LocationId' INTEGER NOT NULL,
 	'Name' VARCHAR (260) NOT NULL,
 	'LocationX' REAL,
 	'LocationY' REAL,
-	'ShouldWaveHeightIllustrationPointsBeCalculated' TINYINT (1) NOT NULL, -- true or false
-	'ShouldDesignWaterLevelIllustrationPointsBeCalculated' TINYINT (1) NOT NULL, -- true or false
 	'Order' INT (4) NOT NULL,
-	CONSTRAINT 'FK_HydraulicLocationEntity_AssessmentSectionEntity' FOREIGN KEY ('AssessmentSectionEntityId') REFERENCES 'AssessmentSectionEntity' ('AssessmentSectionEntityId') ON DELETE Cascade ON UPDATE Cascade
+	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')
 )
 ;
 
@@ -561,6 +586,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,
@@ -571,14 +607,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
 )
 ;
 
@@ -610,22 +644,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
 )
 ;
 
@@ -649,17 +685,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,
@@ -1452,19 +1477,17 @@
 
 CREATE TABLE 'HydraulicLocationOutputEntity'
 (
-	'HydraulicLocationEntityOutputId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
-	'HydraulicLocationEntityId' INTEGER NOT NULL,
+	'HydraulicLocationOutputEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
+	'HydraulicLocationCalculationEntityId' INTEGER,
 	'GeneralResultSubMechanismIllustrationPointEntityId' INTEGER,
-	'HydraulicLocationOutputType' TINYINT (1) NOT NULL, -- Enum: 1 = DesignWaterLevel, 2 = WaveHeight
 	'Result' REAL,
 	'TargetProbability' REAL,
 	'TargetReliability' REAL,
 	'CalculatedProbability' REAL,
 	'CalculatedReliability' REAL,
 	'CalculationConvergence' TINYINT (1) NOT NULL, -- Enum: 1 = NotCalculated, 2 = CalculatedNotConverged, 3 = CalculatedConverged
 	CONSTRAINT 'FK_HydraulicLocationOutputEntity_GeneralResultSubMechanismIllustrationPointEntity' FOREIGN KEY ('GeneralResultSubMechanismIllustrationPointEntityId') REFERENCES 'GeneralResultSubMechanismIllustrationPointEntity' ('GeneralResultSubMechanismIllustrationPointEntityId') ON DELETE Set Null ON UPDATE Cascade,
-	CONSTRAINT 'FK_HydraulicLocationOutputEntity_HydraulicLocationEntity' FOREIGN KEY ('HydraulicLocationEntityId') REFERENCES 'HydraulicLocationEntity' ('HydraulicLocationEntityId') ON DELETE Cascade ON UPDATE Cascade,
-	CONSTRAINT 'U_HydraulicLocationEntityOutputType' UNIQUE ('HydraulicLocationEntityId','HydraulicLocationOutputType')
+	CONSTRAINT 'FK_HydraulicLocationOutputEntity_HydraulicLocationCalculationEntity' FOREIGN KEY ('HydraulicLocationCalculationEntityId') REFERENCES 'HydraulicLocationCalculationEntity' ('HydraulicLocationCalculationEntityId') ON DELETE Set Null ON UPDATE Cascade
 )
 ;
 
@@ -1965,6 +1988,13 @@
 )
 ;
 
+CREATE TABLE 'HydraulicLocationCalculationEntity'
+(
+	'HydraulicLocationCalculationEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
+	'ShouldIllustrationPointsBeCalculated' TINYINT (1) NOT NULL -- True or false
+)
+;
+
 /* Create Indexes and Triggers */
 
 CREATE INDEX 'IXFK_GrassCoverErosionInwardsDikeHeightOutputEntity_GeneralResultFaultTreeIllustrationPointEntity'
@@ -1994,14 +2024,14 @@
  ON 'AssessmentSectionEntity' ('ProjectEntityId' ASC)
 ;
 
-CREATE INDEX 'IXFK_MacroStabilityOutwardsFailureMechanismMetaEntity_FailureMechanismEntity'
- ON 'MacroStabilityOutwardsFailureMechanismMetaEntity' ('FailureMechanismEntityId' ASC)
-;
-
 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)
 ;
@@ -2046,6 +2076,133 @@
  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)
 ;
@@ -2062,12 +2219,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'
@@ -2082,10 +2243,6 @@
  ON 'GrassCoverErosionInwardsCalculationEntity' ('HydraulicLocationEntityId' ASC)
 ;
 
-CREATE INDEX 'IXFK_DuneErosionFailureMechanismMetaEntity_FailureMechanismEntity'
- ON 'DuneErosionFailureMechanismMetaEntity' ('FailureMechanismEntityId' ASC)
-;
-
 CREATE INDEX 'IXFK_GrassCoverErosionOutwardsFailureMechanismMetaEntity_FailureMechanismEntity'
  ON 'GrassCoverErosionOutwardsFailureMechanismMetaEntity' ('FailureMechanismEntityId' ASC)
 ;
@@ -2390,8 +2547,8 @@
  ON 'HydraulicLocationOutputEntity' ('GeneralResultSubMechanismIllustrationPointEntityId' ASC)
 ;
 
-CREATE INDEX 'IXFK_HydraulicLocationOutputEntity_HydraulicLocationEntity'
- ON 'HydraulicLocationOutputEntity' ('HydraulicLocationEntityId' ASC)
+CREATE INDEX 'IXFK_HydraulicLocationOutputEntity_HydraulicLocationCalculationEntity'
+ ON 'HydraulicLocationOutputEntity' ('HydraulicLocationCalculationEntityId' ASC)
 ;
 CREATE TRIGGER [TR_AfterDeleteHydraulicLocationOutputEntity_RemoveGeneralResultSubMechanismIllustrationPointEntity]
 	AFTER DELETE
