Index: build/DatabaseStructure.sql
===================================================================
diff -u -ra096cb901099c85dbaafa2dba6c69288464c248e -rbd21fbd130d32ac7d8f5acc37e20dc2e7fb3b6d4
--- build/DatabaseStructure.sql	(.../DatabaseStructure.sql)	(revision a096cb901099c85dbaafa2dba6c69288464c248e)
+++ build/DatabaseStructure.sql	(.../DatabaseStructure.sql)	(revision bd21fbd130d32ac7d8f5acc37e20dc2e7fb3b6d4)
@@ -1,6 +1,6 @@
 /* ---------------------------------------------------- */
 /*  Generated by Enterprise Architect Version 12.0 		*/
-/*  Created On : 07-Sep-2017 10:06:30 AM 				*/
+/*  Created On : 07-Sep-2017 3:09:10 PM 				*/
 /*  DBMS       : SQLite 								*/
 /* ---------------------------------------------------- */
 
@@ -18,57 +18,60 @@
 DROP TABLE IF EXISTS 'AssessmentSectionEntity'
 ;
 
-DROP TABLE IF EXISTS 'StabilityPointStructuresCalculationEntity'
+DROP TABLE IF EXISTS 'MacroStabilityInwardsFailureMechanismMetaEntity'
 ;
 
-DROP TABLE IF EXISTS 'FailureMechanismSectionEntity'
+DROP TABLE IF EXISTS 'FailureMechanismEntity'
 ;
 
-DROP TABLE IF EXISTS 'PipingFailureMechanismMetaEntity'
+DROP TABLE IF EXISTS 'FailureMechanismSectionEntity'
 ;
 
-DROP TABLE IF EXISTS 'FailureMechanismEntity'
+DROP TABLE IF EXISTS 'StabilityPointStructuresCalculationEntity'
 ;
 
-DROP TABLE IF EXISTS 'StabilityStoneCoverFailureMechanismMetaEntity'
+DROP TABLE IF EXISTS 'PipingFailureMechanismMetaEntity'
 ;
 
 DROP TABLE IF EXISTS 'ClosingStructuresFailureMechanismMetaEntity'
 ;
 
-DROP TABLE IF EXISTS 'StabilityPointStructuresFailureMechanismMetaEntity'
+DROP TABLE IF EXISTS 'StabilityStoneCoverFailureMechanismMetaEntity'
 ;
 
 DROP TABLE IF EXISTS 'CalculationGroupEntity'
 ;
 
+DROP TABLE IF EXISTS 'StabilityPointStructuresFailureMechanismMetaEntity'
+;
+
 DROP TABLE IF EXISTS 'HydraulicLocationEntity'
 ;
 
-DROP TABLE IF EXISTS 'DuneErosionFailureMechanismMetaEntity'
+DROP TABLE IF EXISTS 'PipingCalculationEntity'
 ;
 
 DROP TABLE IF EXISTS 'GrassCoverErosionInwardsFailureMechanismMetaEntity'
 ;
 
-DROP TABLE IF EXISTS 'PipingCalculationEntity'
+DROP TABLE IF EXISTS 'DuneErosionFailureMechanismMetaEntity'
 ;
 
-DROP TABLE IF EXISTS 'HeightStructuresFailureMechanismMetaEntity'
-;
-
 DROP TABLE IF EXISTS 'GrassCoverErosionInwardsCalculationEntity'
 ;
 
 DROP TABLE IF EXISTS 'GrassCoverErosionOutwardsFailureMechanismMetaEntity'
 ;
 
-DROP TABLE IF EXISTS 'PipingSoilProfileEntity'
+DROP TABLE IF EXISTS 'HeightStructuresFailureMechanismMetaEntity'
 ;
 
 DROP TABLE IF EXISTS 'PipingSoilLayerEntity'
 ;
 
+DROP TABLE IF EXISTS 'PipingSoilProfileEntity'
+;
+
 DROP TABLE IF EXISTS 'PipingStochasticSoilProfileEntity'
 ;
 
@@ -126,10 +129,10 @@
 DROP TABLE IF EXISTS 'WaveImpactAsphaltCoverSectionResultEntity'
 ;
 
-DROP TABLE IF EXISTS 'MicrostabilitySectionResultEntity'
+DROP TABLE IF EXISTS 'WaveImpactAsphaltCoverFailureMechanismMetaEntity'
 ;
 
-DROP TABLE IF EXISTS 'WaveImpactAsphaltCoverFailureMechanismMetaEntity'
+DROP TABLE IF EXISTS 'MicrostabilitySectionResultEntity'
 ;
 
 DROP TABLE IF EXISTS 'PipingStructureSectionResultEntity'
@@ -258,6 +261,24 @@
 DROP TABLE IF EXISTS 'FaultTreeSubmechanismIllustrationPointEntity'
 ;
 
+DROP TABLE IF EXISTS 'MacroStabilityInwardsCharacteristicPointEntity'
+;
+
+DROP TABLE IF EXISTS 'MacroStabilityInwardsSoilLayer1DEntity'
+;
+
+DROP TABLE IF EXISTS 'MacroStabilityInwardsSoilProfile1DEntity'
+;
+
+DROP TABLE IF EXISTS 'MacroStabilityInwardsSoilLayer2DEntity'
+;
+
+DROP TABLE IF EXISTS 'MacroStabilityInwardsSoilProfile2DEntity'
+;
+
+DROP TABLE IF EXISTS 'MacroStabilityInwardsStochasticSoilProfileEntity'
+;
+
 /* Create Tables with Primary and Foreign Keys, Check and Unique Constraints */
 
 CREATE TABLE 'GrassCoverErosionInwardsDikeHeightOutputEntity'
@@ -312,6 +333,45 @@
 )
 ;
 
+CREATE TABLE 'MacroStabilityInwardsFailureMechanismMetaEntity'
+(
+	'MacroStabilityInwardsFailureMechanismMetaEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
+	'FailureMechanismEntityId' INTEGER NOT NULL,
+	'A' REAL NOT NULL,
+	'B' REAL NOT NULL,
+	'SectionLength' REAL,
+	'StochasticSoilModelCollectionSourcePath' TEXT,
+	'SurfaceLineCollectionSourcePath' TEXT,
+	CONSTRAINT 'FK_MacroStabilityInwardsFailureMechanismMetaEntity_FailureMechanismEntity' FOREIGN KEY ('FailureMechanismEntityId') REFERENCES 'FailureMechanismEntity' ('FailureMechanismEntityId') ON DELETE Cascade ON UPDATE Cascade
+)
+;
+
+CREATE TABLE 'FailureMechanismEntity'
+(
+	'FailureMechanismEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
+	'AssessmentSectionEntityId' INTEGER NOT NULL,
+	'CalculationGroupEntityId' INTEGER,
+	'FailureMechanismType' SMALLINT NOT NULL, -- Enum: 1 = Piping, 2 = Macrostabiliteit binnenwaarts, 3= Golfklappen op asfaltbekleding, 4= Grasbekleding erosie buitentalud, 5 = Grasbekleding afschuiven buitentalud, 6 = Grasbekleding erosie kruin en binnentalud, 7 = Stabiliteit steenzetting, 8 = Duinafslag, 9 = Hoogte kunstwerk, 10 = Betrouwbaarheid sluiten kunstwerk, 11 = Piping bij kunstwerk, 12 = Sterkte en stabiliteit puntconstructires, 13 = Macrostabiliteit buitenwaarts, 14 = Microstabiliteit, 15 = Wateroverdruk bij asfaltbekleding, 16 = Grasbekleding afschuiven binnentalud, 17 = Sterkte en stabiliteit langsconstructires, 18 = Technische innovaties
+	'IsRelevant' TINYINT (1) NOT NULL, -- true or false
+	'InputComments' TEXT,
+	'OutputComments' TEXT,
+	'NotRelevantComments' TEXT,
+	CONSTRAINT 'FK_FailureMechanismEntity_AssessmentSectionEntity' FOREIGN KEY ('AssessmentSectionEntityId') REFERENCES 'AssessmentSectionEntity' ('AssessmentSectionEntityId') ON DELETE Cascade ON UPDATE Cascade,
+	CONSTRAINT 'FK_FailureMechanismEntity_CalculationGroupEntity' FOREIGN KEY ('CalculationGroupEntityId') REFERENCES 'CalculationGroupEntity' ('CalculationGroupEntityId') ON DELETE Cascade ON UPDATE Cascade,
+	CONSTRAINT 'UI_AssessmentSectionEntityId_FailureMechanismType' UNIQUE ('AssessmentSectionEntityId','FailureMechanismType')
+)
+;
+
+CREATE TABLE 'FailureMechanismSectionEntity'
+(
+	'FailureMechanismSectionEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
+	'FailureMechanismEntityId' INTEGER NOT NULL,
+	'Name' VARCHAR (260) NOT NULL,
+	'FailureMechanismSectionPointXml' TEXT NOT NULL,
+	CONSTRAINT 'FK_FailureMechanismSectionEntity_FailureMechanismEntity' FOREIGN KEY ('FailureMechanismEntityId') REFERENCES 'FailureMechanismEntity' ('FailureMechanismEntityId') ON DELETE Cascade ON UPDATE Cascade
+)
+;
+
 CREATE TABLE 'StabilityPointStructuresCalculationEntity'
 (
 	'StabilityPointStructuresCalculationEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
@@ -385,16 +445,6 @@
 )
 ;
 
-CREATE TABLE 'FailureMechanismSectionEntity'
-(
-	'FailureMechanismSectionEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
-	'FailureMechanismEntityId' INTEGER NOT NULL,
-	'Name' VARCHAR (260) NOT NULL,
-	'FailureMechanismSectionPointXml' TEXT NOT NULL,
-	CONSTRAINT 'FK_FailureMechanismSectionEntity_FailureMechanismEntity' FOREIGN KEY ('FailureMechanismEntityId') REFERENCES 'FailureMechanismEntity' ('FailureMechanismEntityId') ON DELETE Cascade ON UPDATE Cascade
-)
-;
-
 CREATE TABLE 'PipingFailureMechanismMetaEntity'
 (
 	'PipingFailureMechanismMetaEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
@@ -407,19 +457,14 @@
 )
 ;
 
-CREATE TABLE 'FailureMechanismEntity'
+CREATE TABLE 'ClosingStructuresFailureMechanismMetaEntity'
 (
-	'FailureMechanismEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
-	'AssessmentSectionEntityId' INTEGER NOT NULL,
-	'CalculationGroupEntityId' INTEGER,
-	'FailureMechanismType' SMALLINT NOT NULL, -- Enum: 1 = Piping, 2 = Macrostabiliteit binnenwaarts, 3= Golfklappen op asfaltbekleding, 4= Grasbekleding erosie buitentalud, 5 = Grasbekleding afschuiven buitentalud, 6 = Grasbekleding erosie kruin en binnentalud, 7 = Stabiliteit steenzetting, 8 = Duinafslag, 9 = Hoogte kunstwerk, 10 = Betrouwbaarheid sluiten kunstwerk, 11 = Piping bij kunstwerk, 12 = Sterkte en stabiliteit puntconstructires, 13 = Macrostabiliteit buitenwaarts, 14 = Microstabiliteit, 15 = Wateroverdruk bij asfaltbekleding, 16 = Grasbekleding afschuiven binnentalud, 17 = Sterkte en stabiliteit langsconstructires, 18 = Technische innovaties
-	'IsRelevant' TINYINT (1) NOT NULL, -- true or false
-	'InputComments' TEXT,
-	'OutputComments' TEXT,
-	'NotRelevantComments' TEXT,
-	CONSTRAINT 'FK_FailureMechanismEntity_AssessmentSectionEntity' FOREIGN KEY ('AssessmentSectionEntityId') REFERENCES 'AssessmentSectionEntity' ('AssessmentSectionEntityId') ON DELETE Cascade ON UPDATE Cascade,
-	CONSTRAINT 'FK_FailureMechanismEntity_CalculationGroupEntity' FOREIGN KEY ('CalculationGroupEntityId') REFERENCES 'CalculationGroupEntity' ('CalculationGroupEntityId') ON DELETE Cascade ON UPDATE Cascade,
-	CONSTRAINT 'UI_AssessmentSectionEntityId_FailureMechanismType' UNIQUE ('AssessmentSectionEntityId','FailureMechanismType')
+	'ClosingStructuresFailureMechanismMetaEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
+	'FailureMechanismEntityId' INTEGER NOT NULL,
+	'N2A' INT (4) NOT NULL,
+	'ClosingStructureCollectionSourcePath' TEXT,
+	'ForeshoreProfileCollectionSourcePath' TEXT,
+	CONSTRAINT 'FK_ClosingStructuresFailureMechanismMetaEntity_FailureMechanismEntity' FOREIGN KEY ('FailureMechanismEntityId') REFERENCES 'FailureMechanismEntity' ('FailureMechanismEntityId') ON DELETE Cascade ON UPDATE Cascade
 )
 ;
 
@@ -432,14 +477,13 @@
 )
 ;
 
-CREATE TABLE 'ClosingStructuresFailureMechanismMetaEntity'
+CREATE TABLE 'CalculationGroupEntity'
 (
-	'ClosingStructuresFailureMechanismMetaEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
-	'FailureMechanismEntityId' INTEGER NOT NULL,
-	'N2A' INT (4) NOT NULL,
-	'ClosingStructureCollectionSourcePath' TEXT,
-	'ForeshoreProfileCollectionSourcePath' TEXT,
-	CONSTRAINT 'FK_ClosingStructuresFailureMechanismMetaEntity_FailureMechanismEntity' FOREIGN KEY ('FailureMechanismEntityId') REFERENCES 'FailureMechanismEntity' ('FailureMechanismEntityId') ON DELETE Cascade ON UPDATE Cascade
+	'CalculationGroupEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
+	'ParentCalculationGroupEntityId' INTEGER,
+	'Name' VARCHAR (260),
+	'Order' INT (4) NOT NULL,
+	CONSTRAINT 'FK_CalculationGroupEntity_CalculationGroupEntity' FOREIGN KEY ('ParentCalculationGroupEntityId') REFERENCES 'CalculationGroupEntity' ('CalculationGroupEntityId') ON DELETE Cascade ON UPDATE Cascade
 )
 ;
 
@@ -454,16 +498,6 @@
 )
 ;
 
-CREATE TABLE 'CalculationGroupEntity'
-(
-	'CalculationGroupEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
-	'ParentCalculationGroupEntityId' INTEGER,
-	'Name' VARCHAR (260),
-	'Order' INT (4) NOT NULL,
-	CONSTRAINT 'FK_CalculationGroupEntity_CalculationGroupEntity' FOREIGN KEY ('ParentCalculationGroupEntityId') REFERENCES 'CalculationGroupEntity' ('CalculationGroupEntityId') ON DELETE Cascade ON UPDATE Cascade
-)
-;
-
 CREATE TABLE 'HydraulicLocationEntity'
 (
 	'HydraulicLocationEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
@@ -479,25 +513,6 @@
 )
 ;
 
-CREATE TABLE 'DuneErosionFailureMechanismMetaEntity'
-(
-	'DuneErosionFailureMechanismMetaEntityId' 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
-)
-;
-
-CREATE TABLE 'GrassCoverErosionInwardsFailureMechanismMetaEntity'
-(
-	'GrassCoverErosionInwardsFailureMechanismMetaEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
-	'FailureMechanismEntityId' INTEGER NOT NULL,
-	'N' INT (4) NOT NULL,
-	'DikeProfileCollectionSourcePath' TEXT,
-	CONSTRAINT 'FK_GrassCoverErosionInwardsFailureMechanismMetaEntity_FailureMechanismEntity' FOREIGN KEY ('FailureMechanismEntityId') REFERENCES 'FailureMechanismEntity' ('FailureMechanismEntityId') ON DELETE Cascade ON UPDATE Cascade
-)
-;
-
 CREATE TABLE 'PipingCalculationEntity'
 (
 	'PipingCalculationEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
@@ -525,17 +540,25 @@
 )
 ;
 
-CREATE TABLE 'HeightStructuresFailureMechanismMetaEntity'
+CREATE TABLE 'GrassCoverErosionInwardsFailureMechanismMetaEntity'
 (
-	'HeightStructuresFailureMechanismMetaEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
+	'GrassCoverErosionInwardsFailureMechanismMetaEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
 	'FailureMechanismEntityId' INTEGER NOT NULL,
 	'N' INT (4) NOT NULL,
-	'HeightStructureCollectionSourcePath' TEXT,
-	'ForeshoreProfileCollectionSourcePath' TEXT,
-	CONSTRAINT 'FK_HeightStructuresFailureMechanismMetaEntity_FailureMechanismEntity' FOREIGN KEY ('FailureMechanismEntityId') REFERENCES 'FailureMechanismEntity' ('FailureMechanismEntityId') ON DELETE Cascade ON UPDATE Cascade
+	'DikeProfileCollectionSourcePath' TEXT,
+	CONSTRAINT 'FK_GrassCoverErosionInwardsFailureMechanismMetaEntity_FailureMechanismEntity' FOREIGN KEY ('FailureMechanismEntityId') REFERENCES 'FailureMechanismEntity' ('FailureMechanismEntityId') ON DELETE Cascade ON UPDATE Cascade
 )
 ;
 
+CREATE TABLE 'DuneErosionFailureMechanismMetaEntity'
+(
+	'DuneErosionFailureMechanismMetaEntityId' 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
+)
+;
+
 CREATE TABLE 'GrassCoverErosionInwardsCalculationEntity'
 (
 	'GrassCoverErosionInwardsCalculationEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
@@ -574,12 +597,14 @@
 )
 ;
 
-CREATE TABLE 'PipingSoilProfileEntity'
+CREATE TABLE 'HeightStructuresFailureMechanismMetaEntity'
 (
-	'PipingSoilProfileEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
-	'Bottom' REAL,
-	'Name' TEXT NOT NULL,
-	'SourceType' TINYINT (1) NOT NULL -- Enum: 1 = SoilProfile1D,  2 = SoilProfile2D
+	'HeightStructuresFailureMechanismMetaEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
+	'FailureMechanismEntityId' INTEGER NOT NULL,
+	'N' INT (4) NOT NULL,
+	'HeightStructureCollectionSourcePath' TEXT,
+	'ForeshoreProfileCollectionSourcePath' TEXT,
+	CONSTRAINT 'FK_HeightStructuresFailureMechanismMetaEntity_FailureMechanismEntity' FOREIGN KEY ('FailureMechanismEntityId') REFERENCES 'FailureMechanismEntity' ('FailureMechanismEntityId') ON DELETE Cascade ON UPDATE Cascade
 )
 ;
 
@@ -603,6 +628,15 @@
 )
 ;
 
+CREATE TABLE 'PipingSoilProfileEntity'
+(
+	'PipingSoilProfileEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
+	'Bottom' REAL,
+	'Name' TEXT NOT NULL,
+	'SourceType' TINYINT (1) NOT NULL -- Enum: 1 = SoilProfile1D,  2 = SoilProfile2D
+)
+;
+
 CREATE TABLE 'PipingStochasticSoilProfileEntity'
 (
 	'PipingStochasticSoilProfileEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
@@ -840,6 +874,15 @@
 )
 ;
 
+CREATE TABLE 'WaveImpactAsphaltCoverFailureMechanismMetaEntity'
+(
+	'WaveImpactAsphaltCoverFailureMechanismMetaEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
+	'FailureMechanismEntityId' INTEGER NOT NULL,
+	'ForeshoreProfileCollectionSourcePath' TEXT,
+	CONSTRAINT 'FK_WaveImpactAsphaltCoverFailureMechanismMetaEntity_FailureMechanismEntity' FOREIGN KEY ('FailureMechanismEntityId') REFERENCES 'FailureMechanismEntity' ('FailureMechanismEntityId') ON DELETE Cascade ON UPDATE Cascade
+)
+;
+
 CREATE TABLE 'MicrostabilitySectionResultEntity'
 (
 	'MicrostabilitySectionResultEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
@@ -851,15 +894,6 @@
 )
 ;
 
-CREATE TABLE 'WaveImpactAsphaltCoverFailureMechanismMetaEntity'
-(
-	'WaveImpactAsphaltCoverFailureMechanismMetaEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
-	'FailureMechanismEntityId' INTEGER NOT NULL,
-	'ForeshoreProfileCollectionSourcePath' TEXT,
-	CONSTRAINT 'FK_WaveImpactAsphaltCoverFailureMechanismMetaEntity_FailureMechanismEntity' FOREIGN KEY ('FailureMechanismEntityId') REFERENCES 'FailureMechanismEntity' ('FailureMechanismEntityId') ON DELETE Cascade ON UPDATE Cascade
-)
-;
-
 CREATE TABLE 'PipingStructureSectionResultEntity'
 (
 	'PipingStructureSectionResultEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
@@ -1624,6 +1658,108 @@
 )
 ;
 
+CREATE TABLE 'MacroStabilityInwardsCharacteristicPointEntity'
+(
+	'MacroStabilityInwardsCharacteristicPointEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
+	'SurfaceLineEntityId' INTEGER NOT NULL,
+	'Type' SMALLINT NOT NULL, -- Enumtype: 1 = SurfaceLevelOutside 2 = SurfaceLevelInside  3 = TrafficLoadOutside 4 = TrafficLoadInside 5 = ShoulderBaseInside 6 = ShoulderTopInside 7 = DikeToeAtRiver 8 = DikeToeAtPolder 9 = BottomDitchDikeSide 10 = BottomDitchPolderSide 11 = DitchDikeSide 12 = DikeTopAtPolder 13 = DitchPolderSide
+	'X' REAL,
+	'Y' REAL,
+	'Z' REAL,
+	CONSTRAINT 'FK_MacroStabilityInwardsCharacteristicPointEntity_SurfaceLineEntity' FOREIGN KEY ('SurfaceLineEntityId') REFERENCES 'SurfaceLineEntity' ('SurfaceLineEntityId') ON DELETE Cascade ON UPDATE Cascade
+)
+;
+
+CREATE TABLE 'MacroStabilityInwardsSoilLayer1DEntity'
+(
+	'MacroStabilityInwardsSoilLayer1DEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
+	'MacroStabilityInwardsSoilProfile1DEntityId' INTEGER NOT NULL,
+	'Top' REAL,
+	'IsAquifer' TINYINT (1) NOT NULL,
+	'Color' INTEGER NOT NULL, -- ARGB value of Color.
+	'MaterialName' TEXT NOT NULL,
+	'ShearStrengthModel' TINYINT (1) NOT NULL, -- Enumtype: 1 = None, 2 = SuCalculated, 3 = CPhi, 4 = CPhiOrSuCalculated
+	'UsePop' TINYINT (1) NOT NULL, -- true of false
+	'AbovePhreaticLevelMean' REAL,
+	'AbovePhreaticLevelDeviation' REAL,
+	'AbovePhreaticLevelShift' REAL,
+	'BelowPhreaticLevelMean' REAL,
+	'BelowPhreaticLevelDeviation' REAL,
+	'BelowPhreaticLevelShift' REAL,
+	'CohesionMean' REAL,
+	'CohesionDeviation' REAL,
+	'FrictionAngleMean' REAL,
+	'FrictionAngleDeviation' REAL,
+	'ShearStrengthRatioMean' REAL,
+	'ShearStrengthRatioDeviation' REAL,
+	'StrengthIncreaseExponentMean' REAL,
+	'StrengthIncreaseExponentDeviation' REAL,
+	'PopMean' REAL,
+	'PopDeviation' REAL,
+	'Order' INT (4) NOT NULL,
+	CONSTRAINT 'FK_MacroStabilityInwardsSoilLayer1DEntity_MacroStabilityInwardsSoilProfile1DEntity' FOREIGN KEY ('MacroStabilityInwardsSoilProfile1DEntityId') REFERENCES 'MacroStabilityInwardsSoilProfile1DEntity' ('MacroStabilityInwardsSoilProfile1DEntityId') ON DELETE Cascade ON UPDATE Cascade
+)
+;
+
+CREATE TABLE 'MacroStabilityInwardsSoilProfile1DEntity'
+(
+	'MacroStabilityInwardsSoilProfile1DEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
+	'Name' TEXT NOT NULL,
+	'Bottom' REAL
+)
+;
+
+CREATE TABLE 'MacroStabilityInwardsSoilLayer2DEntity'
+(
+	'MacroStabilityInwardsSoilLayer2DEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
+	'MacroStabilityInwardsSoilProfile2DEntityId' INTEGER NOT NULL,
+	'IsAquifer' TINYINT (1) NOT NULL,
+	'Color' INTEGER, -- ARGB value of Color.
+	'MaterialName' TEXT NOT NULL,
+	'ShearStrengthModel' TINYINT (1) NOT NULL, -- Enumtype: 1 = None, 2 = SuCalculated, 3 = CPhi, 4 = CPhiOrSuCalculated
+	'UsePop' TINYINT (1) NOT NULL,
+	'AbovePhreaticLevelMean' REAL,
+	'AbovePhreaticLevelDeviation' REAL,
+	'AbovePhreaticLevelShift' REAL,
+	'BelowPhreaticLevelMean' REAL,
+	'BelowPhreaticLevelDeviation' REAL,
+	'BelowPhreaticLevelShift' REAL,
+	'CohesionMean' REAL,
+	'CohesionDeviation' REAL,
+	'FrictionAngleMean' REAL,
+	'FrictionAngleDeviation' REAL,
+	'ShearStrengthRatioMean' REAL,
+	'ShearStrengthRatioDeviation' REAL,
+	'StrengthIncreaseExponentMean' REAL,
+	'StrengthIncreaseExponentDeviation' REAL,
+	'PopMean' REAL,
+	'PopDeviation' REAL,
+	'Order' INT (4) NOT NULL,
+	CONSTRAINT 'FK_MacroStabilityInwardsSoilLayer2DEntity_MacroStabilityInwardsSoilProfile2DEntity' FOREIGN KEY ('MacroStabilityInwardsSoilProfile2DEntityId') REFERENCES 'MacroStabilityInwardsSoilProfile2DEntity' ('MacroStabilityInwardsSoilProfile2DEntityId') ON DELETE Cascade ON UPDATE Cascade
+)
+;
+
+CREATE TABLE 'MacroStabilityInwardsSoilProfile2DEntity'
+(
+	'MacroStabilityInwardsSoilProfile2DEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
+	'Name' TEXT NOT NULL
+)
+;
+
+CREATE TABLE 'MacroStabilityInwardsStochasticSoilProfileEntity'
+(
+	'MacroStabilityInwardsStochasticSoilProfileEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
+	'StochasticSoilModelEntityId' INTEGER NOT NULL,
+	'MacroStabilityInwardsSoilProfile1DEntityId' INTEGER,
+	'MacroStabilityInwardsSoilProfile2DEntityId' INTEGER,
+	'Probability' REAL NOT NULL,
+	'Order' INT (4) NOT NULL,
+	CONSTRAINT 'FK_MacroStabilityInwardsStochasticSoilProfileEntity_MacroStabilityInwardsSoilProfile1DEntity' FOREIGN KEY ('MacroStabilityInwardsSoilProfile1DEntityId') REFERENCES 'MacroStabilityInwardsSoilProfile1DEntity' ('MacroStabilityInwardsSoilProfile1DEntityId') ON DELETE Cascade ON UPDATE Cascade,
+	CONSTRAINT 'FK_MacroStabilityInwardsStochasticSoilProfileEntity_MacroStabilityInwardsSoilProfile2DEntity' FOREIGN KEY ('MacroStabilityInwardsSoilProfile2DEntityId') REFERENCES 'MacroStabilityInwardsSoilProfile2DEntity' ('MacroStabilityInwardsSoilProfile2DEntityId') ON DELETE Cascade ON UPDATE Cascade,
+	CONSTRAINT 'FK_MacroStabilityInwardsStochasticSoilProfileEntity_StochasticSoilModelEntity' FOREIGN KEY ('StochasticSoilModelEntityId') REFERENCES 'StochasticSoilModelEntity' ('StochasticSoilModelEntityId') ON DELETE Cascade ON UPDATE Cascade
+)
+;
+
 /* Create Indexes and Triggers */
 
 CREATE INDEX 'IXFK_GrassCoverErosionInwardsDikeHeightOutputEntity_GeneralResultFaultTreeIllustrationPointEntity'
@@ -1649,6 +1785,22 @@
  ON 'AssessmentSectionEntity' ('ProjectEntityId' ASC)
 ;
 
+CREATE INDEX 'IXFK_MacroStabilityInwardsFailureMechanismMetaEntity_FailureMechanismEntity'
+ ON 'MacroStabilityInwardsFailureMechanismMetaEntity' ('FailureMechanismEntityId' ASC)
+;
+
+CREATE INDEX 'IXFK_FailureMechanismEntity_AssessmentSectionEntity'
+ ON 'FailureMechanismEntity' ('AssessmentSectionEntityId' ASC)
+;
+
+CREATE INDEX 'IXFK_FailureMechanismEntity_CalculationGroupEntity'
+ ON 'FailureMechanismEntity' ('CalculationGroupEntityId' ASC)
+;
+
+CREATE INDEX 'IXFK_FailureMechanismSectionEntity_FailureMechanismEntity'
+ ON 'FailureMechanismSectionEntity' ('FailureMechanismEntityId' ASC)
+;
+
 CREATE INDEX 'IXFK_StabilityPointStructuresCalculationEntity_CalculationGroupEntity'
  ON 'StabilityPointStructuresCalculationEntity' ('CalculationGroupEntityId' ASC)
 ;
@@ -1665,50 +1817,30 @@
  ON 'StabilityPointStructuresCalculationEntity' ('StabilityPointStructureEntityId' ASC)
 ;
 
-CREATE INDEX 'IXFK_FailureMechanismSectionEntity_FailureMechanismEntity'
- ON 'FailureMechanismSectionEntity' ('FailureMechanismEntityId' ASC)
-;
-
 CREATE INDEX 'IXFK_PipingFailureMechanismMetaEntity_FailureMechanismEntity'
  ON 'PipingFailureMechanismMetaEntity' ('FailureMechanismEntityId' ASC)
 ;
 
-CREATE INDEX 'IXFK_FailureMechanismEntity_AssessmentSectionEntity'
- ON 'FailureMechanismEntity' ('AssessmentSectionEntityId' ASC)
+CREATE INDEX 'IXFK_ClosingStructuresFailureMechanismMetaEntity_FailureMechanismEntity'
+ ON 'ClosingStructuresFailureMechanismMetaEntity' ('FailureMechanismEntityId' ASC)
 ;
 
-CREATE INDEX 'IXFK_FailureMechanismEntity_CalculationGroupEntity'
- ON 'FailureMechanismEntity' ('CalculationGroupEntityId' ASC)
-;
-
 CREATE INDEX 'IXFK_StabilityStoneCoverFailureMechanismMetaEntity_FailureMechanismEntity'
  ON 'StabilityStoneCoverFailureMechanismMetaEntity' ('FailureMechanismEntityId' ASC)
 ;
 
-CREATE INDEX 'IXFK_ClosingStructuresFailureMechanismMetaEntity_FailureMechanismEntity'
- ON 'ClosingStructuresFailureMechanismMetaEntity' ('FailureMechanismEntityId' ASC)
+CREATE INDEX 'IXFK_CalculationGroupEntity_CalculationGroupEntity'
+ ON 'CalculationGroupEntity' ('ParentCalculationGroupEntityId' ASC)
 ;
 
 CREATE INDEX 'IXFK_StrengthStabilityPointConstructionFailureMechanismMetaEntity_FailureMechanismEntity'
  ON 'StabilityPointStructuresFailureMechanismMetaEntity' ('FailureMechanismEntityId' ASC)
 ;
 
-CREATE INDEX 'IXFK_CalculationGroupEntity_CalculationGroupEntity'
- ON 'CalculationGroupEntity' ('ParentCalculationGroupEntityId' ASC)
-;
-
 CREATE INDEX 'IXFK_HydraulicLocationEntity_AssessmentSectionEntity'
  ON 'HydraulicLocationEntity' ('AssessmentSectionEntityId' ASC)
 ;
 
-CREATE INDEX 'IXFK_DuneErosionFailureMechanismMetaEntity_FailureMechanismEntity'
- ON 'DuneErosionFailureMechanismMetaEntity' ('FailureMechanismEntityId' ASC)
-;
-
-CREATE INDEX 'IXFK_GrassCoverErosionInwardsFailureMechanismMetaEntity_FailureMechanismEntity'
- ON 'GrassCoverErosionInwardsFailureMechanismMetaEntity' ('FailureMechanismEntityId' ASC)
-;
-
 CREATE INDEX 'IXFK_PipingCalculationEntity_StochasticSoilProfileEntity'
  ON 'PipingCalculationEntity' ('StochasticSoilProfileEntityId' ASC)
 ;
@@ -1725,10 +1857,14 @@
  ON 'PipingCalculationEntity' ('CalculationGroupEntityId' ASC)
 ;
 
-CREATE INDEX 'IXFK_HeightStructuresFailureMechanismMetaEntity_FailureMechanismEntity'
- ON 'HeightStructuresFailureMechanismMetaEntity' ('FailureMechanismEntityId' ASC)
+CREATE INDEX 'IXFK_GrassCoverErosionInwardsFailureMechanismMetaEntity_FailureMechanismEntity'
+ ON 'GrassCoverErosionInwardsFailureMechanismMetaEntity' ('FailureMechanismEntityId' ASC)
 ;
 
+CREATE INDEX 'IXFK_DuneErosionFailureMechanismMetaEntity_FailureMechanismEntity'
+ ON 'DuneErosionFailureMechanismMetaEntity' ('FailureMechanismEntityId' ASC)
+;
+
 CREATE INDEX 'IXFK_GrassCoverErosionInwardsCalculationEntity_CalculationGroupEntity'
  ON 'GrassCoverErosionInwardsCalculationEntity' ('CalculationGroupEntityId' ASC)
 ;
@@ -1745,6 +1881,10 @@
  ON 'GrassCoverErosionOutwardsFailureMechanismMetaEntity' ('FailureMechanismEntityId' ASC)
 ;
 
+CREATE INDEX 'IXFK_HeightStructuresFailureMechanismMetaEntity_FailureMechanismEntity'
+ ON 'HeightStructuresFailureMechanismMetaEntity' ('FailureMechanismEntityId' ASC)
+;
+
 CREATE INDEX 'IXFK_PipingStochasticSoilProfileEntity_SoilProfileEntity'
  ON 'PipingStochasticSoilProfileEntity' ('PipingSoilProfileEntityId' ASC)
 ;
@@ -1837,14 +1977,14 @@
  ON 'WaveImpactAsphaltCoverSectionResultEntity' ('FailureMechanismSectionEntityId' ASC)
 ;
 
-CREATE INDEX 'IXFK_MicrostabilitySectionResultEntity_FailureMechanismSectionEntity'
- ON 'MicrostabilitySectionResultEntity' ('FailureMechanismSectionEntityId' ASC)
-;
-
 CREATE INDEX 'IXFK_WaveImpactAsphaltCoverFailureMechanismMetaEntity_FailureMechanismEntity'
  ON 'WaveImpactAsphaltCoverFailureMechanismMetaEntity' ('FailureMechanismEntityId' ASC)
 ;
 
+CREATE INDEX 'IXFK_MicrostabilitySectionResultEntity_FailureMechanismSectionEntity'
+ ON 'MicrostabilitySectionResultEntity' ('FailureMechanismSectionEntityId' ASC)
+;
+
 CREATE INDEX 'IXFK_PipingStructureSectionResultEntity_FailureMechanismSectionEntity'
  ON 'PipingStructureSectionResultEntity' ('FailureMechanismSectionEntityId' ASC)
 ;
@@ -2231,3 +2371,19 @@
 	AND SubmechanismIllustrationPointEntityId IS OLD.SubmechanismIllustrationPointEntityId;
 END; 
 ;
+
+CREATE INDEX 'IXFK_MacroStabilityCharacteristicPointEntity_SurfaceLineEntity'
+ ON 'MacroStabilityInwardsCharacteristicPointEntity' ('SurfaceLineEntityId' ASC)
+;
+
+CREATE INDEX 'IXFK_MacroStabilityInwardsSoilLayer1DEntity_MacroStabilityInwardsSoilProfile1DEntity'
+ ON 'MacroStabilityInwardsSoilLayer1DEntity' ('MacroStabilityInwardsSoilProfile1DEntityId' ASC)
+;
+
+CREATE INDEX 'IXFK_MacroStabilityInwardsSoilLayer2DEntity_MacroStabilityInwardsSoilProfile2DEntity'
+ ON 'MacroStabilityInwardsSoilLayer2DEntity' ('MacroStabilityInwardsSoilProfile2DEntityId' ASC)
+;
+
+CREATE INDEX 'IXFK_MacroStabilityInwardsStochasticSoilProfileEntity_StochasticSoilModelEntity'
+ ON 'MacroStabilityInwardsStochasticSoilProfileEntity' ('StochasticSoilModelEntityId' ASC)
+;
