Index: Riskeer/Common/src/Riskeer.Common.Util/ProjectVersionHelper.cs =================================================================== diff -u -r785694b7c3a2cd31efc47aec1799b918d10b6c31 -r22a1505cd4329747b28df26d6042e997eca20882 --- Riskeer/Common/src/Riskeer.Common.Util/ProjectVersionHelper.cs (.../ProjectVersionHelper.cs) (revision 785694b7c3a2cd31efc47aec1799b918d10b6c31) +++ Riskeer/Common/src/Riskeer.Common.Util/ProjectVersionHelper.cs (.../ProjectVersionHelper.cs) (revision 22a1505cd4329747b28df26d6042e997eca20882) @@ -30,7 +30,7 @@ public static class ProjectVersionHelper { private const string validDatabaseVersion = "5"; - private const string currentDatabaseVersion = "20.1"; + private const string currentDatabaseVersion = "21.1"; /// /// Gets the current database version. Index: Riskeer/Common/test/Riskeer.Common.Util.Test/ProjectVersionHelperTest.cs =================================================================== diff -u -rb03ea543c850cf2fcdbcf53bd89d11dba2f48020 -r22a1505cd4329747b28df26d6042e997eca20882 --- Riskeer/Common/test/Riskeer.Common.Util.Test/ProjectVersionHelperTest.cs (.../ProjectVersionHelperTest.cs) (revision b03ea543c850cf2fcdbcf53bd89d11dba2f48020) +++ Riskeer/Common/test/Riskeer.Common.Util.Test/ProjectVersionHelperTest.cs (.../ProjectVersionHelperTest.cs) (revision 22a1505cd4329747b28df26d6042e997eca20882) @@ -35,12 +35,12 @@ string currentVersion = ProjectVersionHelper.GetCurrentDatabaseVersion(); // Assert - Assert.AreEqual("20.1", currentVersion); + Assert.AreEqual("21.1", currentVersion); } [Test] [TestCase("9000.0")] - [TestCase("20.2")] + [TestCase("21.2")] public void IsNewerThanCurrentString_NewerVersion_ReturnsTrue(string newerVersion) { // Call @@ -113,22 +113,22 @@ public void ValidateVersion_ValidVersion_DoesNotThrowException(string validVersion) { // Call - TestDelegate call = () => ProjectVersionHelper.ValidateVersion(validVersion); + void Call() => ProjectVersionHelper.ValidateVersion(validVersion); // Assert - Assert.DoesNotThrow(call); + Assert.DoesNotThrow(Call); } [Test] [TestCaseSource(nameof(InvalidVersions))] public void ValidateVersion_InvalidVersion_ThrowArgumentException(string validVersion) { // Call - TestDelegate call = () => ProjectVersionHelper.ValidateVersion(validVersion); + void Call() => ProjectVersionHelper.ValidateVersion(validVersion); // Assert - string expectedMessage = $@"'{validVersion}' is geen geldige Riskeer of Ringtoets projectbestand versie."; - TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, expectedMessage); + var expectedMessage = $@"'{validVersion}' is geen geldige Riskeer of Ringtoets projectbestand versie."; + TestHelper.AssertThrowsArgumentExceptionAndTestMessage(Call, expectedMessage); } private static TestCaseData[] ValidVersions() @@ -141,7 +141,7 @@ new TestCaseData("17.3"), new TestCaseData("18.1"), new TestCaseData("19.1"), - new TestCaseData("20.1") + new TestCaseData("21.1") }; } Fisheye: Tag 22a1505cd4329747b28df26d6042e997eca20882 refers to a dead (removed) revision in file `Riskeer/Migration/src/Riskeer.Migration.Core/EmbeddedResources/DatabaseStructure20.1.sql'. Fisheye: No comparison available. Pass `N' to diff? Index: Riskeer/Migration/src/Riskeer.Migration.Core/EmbeddedResources/DatabaseStructure21.1.sql =================================================================== diff -u --- Riskeer/Migration/src/Riskeer.Migration.Core/EmbeddedResources/DatabaseStructure21.1.sql (revision 0) +++ Riskeer/Migration/src/Riskeer.Migration.Core/EmbeddedResources/DatabaseStructure21.1.sql (revision 22a1505cd4329747b28df26d6042e997eca20882) @@ -0,0 +1,2927 @@ +/* ---------------------------------------------------- */ +/* Generated by Enterprise Architect Version 14.1 */ +/* Created On : 08-feb-2021 09:53:06 */ +/* DBMS : SQLite */ +/* ---------------------------------------------------- */ + +/* Drop Tables */ + +DROP TABLE IF EXISTS 'VersionEntity' +; + +DROP TABLE IF EXISTS 'ProjectEntity' +; + +DROP TABLE IF EXISTS 'AssessmentSectionEntity' +; + +DROP TABLE IF EXISTS 'FailureMechanismEntity' +; + +DROP TABLE IF EXISTS 'FailureMechanismSectionEntity' +; + +DROP TABLE IF EXISTS 'ClosingStructuresFailureMechanismMetaEntity' +; + +DROP TABLE IF EXISTS 'CalculationGroupEntity' +; + +DROP TABLE IF EXISTS 'HydraulicLocationEntity' +; + +DROP TABLE IF EXISTS 'GrassCoverErosionInwardsFailureMechanismMetaEntity' +; + +DROP TABLE IF EXISTS 'SemiProbabilisticPipingCalculationEntity' +; + +DROP TABLE IF EXISTS 'GrassCoverErosionInwardsCalculationEntity' +; + +DROP TABLE IF EXISTS 'GrassCoverErosionOutwardsFailureMechanismMetaEntity' +; + +DROP TABLE IF EXISTS 'PipingSoilLayerEntity' +; + +DROP TABLE IF EXISTS 'PipingSoilProfileEntity' +; + +DROP TABLE IF EXISTS 'PipingStochasticSoilProfileEntity' +; + +DROP TABLE IF EXISTS 'StochasticSoilModelEntity' +; + +DROP TABLE IF EXISTS 'SurfaceLineEntity' +; + +DROP TABLE IF EXISTS 'PipingCharacteristicPointEntity' +; + +DROP TABLE IF EXISTS 'WaveImpactAsphaltCoverFailureMechanismMetaEntity' +; + +DROP TABLE IF EXISTS 'BackgroundDataEntity' +; + +DROP TABLE IF EXISTS 'BackgroundDataMetaEntity' +; + +DROP TABLE IF EXISTS 'ClosingStructureEntity' +; + +DROP TABLE IF EXISTS 'ClosingStructuresCalculationEntity' +; + +DROP TABLE IF EXISTS 'ClosingStructuresOutputEntity' +; + +DROP TABLE IF EXISTS 'ClosingStructuresSectionResultEntity' +; + +DROP TABLE IF EXISTS 'DikeProfileEntity' +; + +DROP TABLE IF EXISTS 'DuneErosionFailureMechanismMetaEntity' +; + +DROP TABLE IF EXISTS 'DuneErosionSectionResultEntity' +; + +DROP TABLE IF EXISTS 'DuneLocationCalculationCollectionEntity' +; + +DROP TABLE IF EXISTS 'DuneLocationCalculationEntity' +; + +DROP TABLE IF EXISTS 'DuneLocationCalculationOutputEntity' +; + +DROP TABLE IF EXISTS 'DuneLocationEntity' +; + +DROP TABLE IF EXISTS 'FaultTreeIllustrationPointEntity' +; + +DROP TABLE IF EXISTS 'FaultTreeIllustrationPointStochastEntity' +; + +DROP TABLE IF EXISTS 'FaultTreeSubmechanismIllustrationPointEntity' +; + +DROP TABLE IF EXISTS 'ForeshoreProfileEntity' +; + +DROP TABLE IF EXISTS 'GeneralResultFaultTreeIllustrationPointEntity' +; + +DROP TABLE IF EXISTS 'GeneralResultFaultTreeIllustrationPointStochastEntity' +; + +DROP TABLE IF EXISTS 'GeneralResultSubMechanismIllustrationPointEntity' +; + +DROP TABLE IF EXISTS 'GeneralResultSubMechanismIllustrationPointStochastEntity' +; + +DROP TABLE IF EXISTS 'GrassCoverErosionInwardsDikeHeightOutputEntity' +; + +DROP TABLE IF EXISTS 'GrassCoverErosionInwardsOutputEntity' +; + +DROP TABLE IF EXISTS 'GrassCoverErosionInwardsOvertoppingRateOutputEntity' +; + +DROP TABLE IF EXISTS 'GrassCoverErosionInwardsSectionResultEntity' +; + +DROP TABLE IF EXISTS 'GrassCoverErosionOutwardsSectionResultEntity' +; + +DROP TABLE IF EXISTS 'GrassCoverErosionOutwardsWaveConditionsCalculationEntity' +; + +DROP TABLE IF EXISTS 'GrassCoverErosionOutwardsWaveConditionsOutputEntity' +; + +DROP TABLE IF EXISTS 'GrassCoverSlipOffInwardsSectionResultEntity' +; + +DROP TABLE IF EXISTS 'GrassCoverSlipOffOutwardsSectionResultEntity' +; + +DROP TABLE IF EXISTS 'HeightStructureEntity' +; + +DROP TABLE IF EXISTS 'HeightStructuresCalculationEntity' +; + +DROP TABLE IF EXISTS 'HeightStructuresFailureMechanismMetaEntity' +; + +DROP TABLE IF EXISTS 'HeightStructuresOutputEntity' +; + +DROP TABLE IF EXISTS 'HeightStructuresSectionResultEntity' +; + +DROP TABLE IF EXISTS 'HydraulicBoundaryDatabaseEntity' +; + +DROP TABLE IF EXISTS 'HydraulicLocationCalculationCollectionEntity' +; + +DROP TABLE IF EXISTS 'HydraulicLocationCalculationEntity' +; + +DROP TABLE IF EXISTS 'HydraulicLocationOutputEntity' +; + +DROP TABLE IF EXISTS 'IllustrationPointResultEntity' +; + +DROP TABLE IF EXISTS 'MacroStabilityInwardsCalculationEntity' +; + +DROP TABLE IF EXISTS 'MacroStabilityInwardsCalculationOutputEntity' +; + +DROP TABLE IF EXISTS 'MacroStabilityInwardsCharacteristicPointEntity' +; + +DROP TABLE IF EXISTS 'MacroStabilityInwardsFailureMechanismMetaEntity' +; + +DROP TABLE IF EXISTS 'MacroStabilityInwardsPreconsolidationStressEntity' +; + +DROP TABLE IF EXISTS 'MacroStabilityInwardsSectionResultEntity' +; + +DROP TABLE IF EXISTS 'MacroStabilityInwardsSoilLayerOneDEntity' +; + +DROP TABLE IF EXISTS 'MacroStabilityInwardsSoilLayerTwoDEntity' +; + +DROP TABLE IF EXISTS 'MacroStabilityInwardsSoilProfileOneDEntity' +; + +DROP TABLE IF EXISTS 'MacroStabilityInwardsSoilProfileTwoDEntity' +; + +DROP TABLE IF EXISTS 'MacroStabilityInwardsSoilProfileTwoDSoilLayerTwoDEntity' +; + +DROP TABLE IF EXISTS 'MacroStabilityInwardsStochasticSoilProfileEntity' +; + +DROP TABLE IF EXISTS 'MacroStabilityOutwardsFailureMechanismMetaEntity' +; + +DROP TABLE IF EXISTS 'MacroStabilityOutwardsSectionResultEntity' +; + +DROP TABLE IF EXISTS 'MicrostabilitySectionResultEntity' +; + +DROP TABLE IF EXISTS 'PipingFailureMechanismMetaEntity' +; + +DROP TABLE IF EXISTS 'PipingSectionResultEntity' +; + +DROP TABLE IF EXISTS 'PipingStructureFailureMechanismMetaEntity' +; + +DROP TABLE IF EXISTS 'PipingStructureSectionResultEntity' +; + +DROP TABLE IF EXISTS 'ProbabilisticPipingCalculationEntity' +; + +DROP TABLE IF EXISTS 'ProbabilisticPipingCalculationOutputEntity' +; + +DROP TABLE IF EXISTS 'SemiProbabilisticPipingCalculationOutputEntity' +; + +DROP TABLE IF EXISTS 'StabilityPointStructureEntity' +; + +DROP TABLE IF EXISTS 'StabilityPointStructuresCalculationEntity' +; + +DROP TABLE IF EXISTS 'StabilityPointStructuresFailureMechanismMetaEntity' +; + +DROP TABLE IF EXISTS 'StabilityPointStructuresOutputEntity' +; + +DROP TABLE IF EXISTS 'StabilityPointStructuresSectionResultEntity' +; + +DROP TABLE IF EXISTS 'StabilityStoneCoverFailureMechanismMetaEntity' +; + +DROP TABLE IF EXISTS 'StabilityStoneCoverSectionResultEntity' +; + +DROP TABLE IF EXISTS 'StabilityStoneCoverWaveConditionsCalculationEntity' +; + +DROP TABLE IF EXISTS 'StabilityStoneCoverWaveConditionsOutputEntity' +; + +DROP TABLE IF EXISTS 'StochastEntity' +; + +DROP TABLE IF EXISTS 'StrengthStabilityLengthwiseConstructionSectionResultEntity' +; + +DROP TABLE IF EXISTS 'SubMechanismIllustrationPointEntity' +; + +DROP TABLE IF EXISTS 'SubMechanismIllustrationPointStochastEntity' +; + +DROP TABLE IF EXISTS 'TechnicalInnovationSectionResultEntity' +; + +DROP TABLE IF EXISTS 'TopLevelFaultTreeIllustrationPointEntity' +; + +DROP TABLE IF EXISTS 'TopLevelSubMechanismIllustrationPointEntity' +; + +DROP TABLE IF EXISTS 'WaterPressureAsphaltCoverSectionResultEntity' +; + +DROP TABLE IF EXISTS 'WaveImpactAsphaltCoverSectionResultEntity' +; + +DROP TABLE IF EXISTS 'WaveImpactAsphaltCoverWaveConditionsCalculationEntity' +; + +DROP TABLE IF EXISTS 'WaveImpactAsphaltCoverWaveConditionsOutputEntity' +; + +/* Create Tables with Primary and Foreign Keys, Check and Unique Constraints */ + +CREATE TABLE 'VersionEntity' +( + 'VersionId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'Version' VARCHAR (20) NOT NULL, + 'Timestamp' DATETIME NOT NULL, + 'FingerPrint' BLOB NOT NULL +) +; + +CREATE TABLE 'ProjectEntity' +( + 'ProjectEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'Description' VARCHAR (260) NULL +) +; + +CREATE TABLE 'AssessmentSectionEntity' +( + 'AssessmentSectionEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'ProjectEntityId' INTEGER NOT NULL, + 'HydraulicLocationCalculationCollectionEntity1Id' INTEGER NOT NULL, -- Represents the design water level factorized signaling norm + 'HydraulicLocationCalculationCollectionEntity2Id' INTEGER NOT NULL, -- Represents the design water level signaling norm + 'HydraulicLocationCalculationCollectionEntity3Id' INTEGER NOT NULL, -- Represents the design water level lower limit norm + 'HydraulicLocationCalculationCollectionEntity4Id' INTEGER NOT NULL, -- Represents the design water level factorized lower limit norm + 'HydraulicLocationCalculationCollectionEntity5Id' INTEGER NOT NULL, -- Represents the wave height factorized signaling norm + 'HydraulicLocationCalculationCollectionEntity6Id' INTEGER NOT NULL, -- Represents the wave height signaling norm + 'HydraulicLocationCalculationCollectionEntity7Id' INTEGER NOT NULL, -- Represents the wave height lower limit norm + 'HydraulicLocationCalculationCollectionEntity8Id' INTEGER NOT NULL, -- Represents the wave height factorized lower limit norm + 'Id' TEXT NULL, + 'Name' VARCHAR (260) NULL, + 'Comments' TEXT NULL, + 'LowerLimitNorm' REAL NOT NULL, + 'SignalingNorm' REAL NOT NULL, + 'NormativeNormType' TINYINT (1) NOT NULL, -- EnumType: 1 = LowerLimit, 2 = Signaling + 'Composition' TINYINT (1) NOT NULL, -- Enum: 1 = Dike, 2 = Dune, 3 = DikeAndDune + 'ReferenceLinePointXml' TEXT NULL, + 'Order' INT (4) NOT NULL, + CONSTRAINT 'FK_AssessmentSectionEntity_HydraulicLocationCalculationCollectionEntity1' FOREIGN KEY ('HydraulicLocationCalculationCollectionEntity1Id') REFERENCES 'HydraulicLocationCalculationCollectionEntity' ('HydraulicLocationCalculationCollectionEntityId') ON DELETE No Action ON UPDATE Cascade, + CONSTRAINT 'FK_AssessmentSectionEntity_HydraulicLocationCalculationCollectionEntity2' FOREIGN KEY ('HydraulicLocationCalculationCollectionEntity2Id') REFERENCES 'HydraulicLocationCalculationCollectionEntity' ('HydraulicLocationCalculationCollectionEntityId') ON DELETE No Action ON UPDATE Cascade, + CONSTRAINT 'FK_AssessmentSectionEntity_HydraulicLocationCalculationCollectionEntity3' FOREIGN KEY ('HydraulicLocationCalculationCollectionEntity3Id') REFERENCES 'HydraulicLocationCalculationCollectionEntity' ('HydraulicLocationCalculationCollectionEntityId') ON DELETE No Action ON UPDATE Cascade, + CONSTRAINT 'FK_AssessmentSectionEntity_HydraulicLocationCalculationCollectionEntity4' FOREIGN KEY ('HydraulicLocationCalculationCollectionEntity4Id') REFERENCES 'HydraulicLocationCalculationCollectionEntity' ('HydraulicLocationCalculationCollectionEntityId') ON DELETE No Action ON UPDATE Cascade, + CONSTRAINT 'FK_AssessmentSectionEntity_HydraulicLocationCalculationCollectionEntity5' FOREIGN KEY ('HydraulicLocationCalculationCollectionEntity5Id') REFERENCES 'HydraulicLocationCalculationCollectionEntity' ('HydraulicLocationCalculationCollectionEntityId') ON DELETE No Action ON UPDATE Cascade, + CONSTRAINT 'FK_AssessmentSectionEntity_HydraulicLocationCalculationCollectionEntity6' FOREIGN KEY ('HydraulicLocationCalculationCollectionEntity6Id') REFERENCES 'HydraulicLocationCalculationCollectionEntity' ('HydraulicLocationCalculationCollectionEntityId') ON DELETE No Action ON UPDATE Cascade, + CONSTRAINT 'FK_AssessmentSectionEntity_HydraulicLocationCalculationCollectionEntity7' FOREIGN KEY ('HydraulicLocationCalculationCollectionEntity7Id') REFERENCES 'HydraulicLocationCalculationCollectionEntity' ('HydraulicLocationCalculationCollectionEntityId') ON DELETE No Action ON UPDATE Cascade, + CONSTRAINT 'FK_AssessmentSectionEntity_HydraulicLocationCalculationCollectionEntity8' 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 'U_HydraulicLocationCalculationCollectionEntity1Id' UNIQUE ('HydraulicLocationCalculationCollectionEntity1Id'), + CONSTRAINT 'U_HydraulicLocationCalculationCollectionEntity2Id' UNIQUE ('HydraulicLocationCalculationCollectionEntity2Id'), + CONSTRAINT 'U_HydraulicLocationCalculationCollectionEntity3Id' UNIQUE ('HydraulicLocationCalculationCollectionEntity3Id'), + CONSTRAINT 'U_HydraulicLocationCalculationCollectionEntity4Id' UNIQUE ('HydraulicLocationCalculationCollectionEntity4Id'), + CONSTRAINT 'U_HydraulicLocationCalculationCollectionEntity5Id' UNIQUE ('HydraulicLocationCalculationCollectionEntity5Id'), + CONSTRAINT 'U_HydraulicLocationCalculationCollectionEntity6Id' UNIQUE ('HydraulicLocationCalculationCollectionEntity6Id'), + CONSTRAINT 'U_HydraulicLocationCalculationCollectionEntity7Id' UNIQUE ('HydraulicLocationCalculationCollectionEntity7Id'), + CONSTRAINT 'U_HydraulicLocationCalculationCollectionEntity8Id' UNIQUE ('HydraulicLocationCalculationCollectionEntity8Id') +) +; + +CREATE TABLE 'FailureMechanismEntity' +( + 'FailureMechanismEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'AssessmentSectionEntityId' INTEGER NOT NULL, + 'CalculationGroupEntityId' INTEGER NULL, + '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 + 'FailureMechanismSectionCollectionSourcePath' TEXT NULL, + 'InputComments' TEXT NULL, + 'OutputComments' TEXT NULL, + 'NotRelevantComments' TEXT NULL, + 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 'ClosingStructuresFailureMechanismMetaEntity' +( + 'ClosingStructuresFailureMechanismMetaEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'FailureMechanismEntityId' INTEGER NOT NULL, + 'N2A' INT (4) NOT NULL, + 'ClosingStructureCollectionSourcePath' TEXT NULL, + 'ForeshoreProfileCollectionSourcePath' TEXT NULL, + CONSTRAINT 'FK_ClosingStructuresFailureMechanismMetaEntity_FailureMechanismEntity' FOREIGN KEY ('FailureMechanismEntityId') REFERENCES 'FailureMechanismEntity' ('FailureMechanismEntityId') ON DELETE Cascade ON UPDATE Cascade +) +; + +CREATE TABLE 'CalculationGroupEntity' +( + 'CalculationGroupEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'ParentCalculationGroupEntityId' INTEGER NULL, + 'Name' VARCHAR (260) NULL, + '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, + 'AssessmentSectionEntityId' INTEGER NOT NULL, + 'LocationId' INTEGER NOT NULL, + 'Name' VARCHAR (260) NOT NULL, + 'LocationX' REAL NULL, + 'LocationY' REAL NULL, + 'Order' INT (4) NOT NULL, + CONSTRAINT 'FK_HydraulicLocationEntity_AssessmentSectionEntity' FOREIGN KEY ('AssessmentSectionEntityId') REFERENCES 'AssessmentSectionEntity' ('AssessmentSectionEntityId') ON DELETE Cascade ON UPDATE Cascade +) +; + +CREATE TABLE 'GrassCoverErosionInwardsFailureMechanismMetaEntity' +( + 'GrassCoverErosionInwardsFailureMechanismMetaEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'FailureMechanismEntityId' INTEGER NOT NULL, + 'N' REAL NOT NULL, + 'DikeProfileCollectionSourcePath' TEXT NULL, + CONSTRAINT 'FK_GrassCoverErosionInwardsFailureMechanismMetaEntity_FailureMechanismEntity' FOREIGN KEY ('FailureMechanismEntityId') REFERENCES 'FailureMechanismEntity' ('FailureMechanismEntityId') ON DELETE Cascade ON UPDATE Cascade +) +; + +CREATE TABLE 'SemiProbabilisticPipingCalculationEntity' +( + 'SemiProbabilisticPipingCalculationEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'CalculationGroupEntityId' INTEGER NOT NULL, + 'SurfaceLineEntityId' INTEGER NULL, + 'PipingStochasticSoilProfileEntityId' INTEGER NULL, + 'HydraulicLocationEntityId' INTEGER NULL, + 'Order' INT (4) NOT NULL, + 'Name' VARCHAR (260) NULL, + 'Comments' TEXT NULL, + 'EntryPointL' REAL NULL, + 'ExitPointL' REAL NULL, + 'PhreaticLevelExitMean' REAL NULL, + 'PhreaticLevelExitStandardDeviation' REAL NULL, + 'DampingFactorExitMean' REAL NULL, + 'DampingFactorExitStandardDeviation' REAL NULL, + 'RelevantForScenario' TINYINT (1) NOT NULL, -- true or false + 'ScenarioContribution' REAL NOT NULL, + 'AssessmentLevel' REAL NULL, + 'UseAssessmentLevelManualInput' TINYINT (1) NOT NULL, -- true or false + CONSTRAINT 'FK_SemiProbabilisticPipingCalculationEntity_CalculationGroupEntity' FOREIGN KEY ('CalculationGroupEntityId') REFERENCES 'CalculationGroupEntity' ('CalculationGroupEntityId') ON DELETE Cascade ON UPDATE Cascade, + CONSTRAINT 'FK_SemiProbabilisticPipingCalculationEntity_HydraulicLocationEntity' FOREIGN KEY ('HydraulicLocationEntityId') REFERENCES 'HydraulicLocationEntity' ('HydraulicLocationEntityId') ON DELETE Set Null ON UPDATE Cascade, + CONSTRAINT 'FK_SemiProbabilisticPipingCalculationEntity_PipingStochasticSoilProfileEntity' FOREIGN KEY ('PipingStochasticSoilProfileEntityId') REFERENCES 'PipingStochasticSoilProfileEntity' ('PipingStochasticSoilProfileEntityId') ON DELETE Set Null ON UPDATE Cascade, + CONSTRAINT 'FK_SemiProbabilisticPipingCalculationEntity_SurfaceLineEntity' FOREIGN KEY ('SurfaceLineEntityId') REFERENCES 'SurfaceLineEntity' ('SurfaceLineEntityId') ON DELETE Set Null ON UPDATE Cascade +) +; + +CREATE TABLE 'GrassCoverErosionInwardsCalculationEntity' +( + 'GrassCoverErosionInwardsCalculationEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'CalculationGroupEntityId' INTEGER NOT NULL, + 'HydraulicLocationEntityId' INTEGER NULL, + 'DikeProfileEntityId' INTEGER NULL, + 'Order' INT (4) NOT NULL, + 'Name' VARCHAR (260) NULL, + 'Comments' TEXT NULL, + 'Orientation' REAL NULL, + 'CriticalFlowRateMean' REAL NULL, + 'CriticalFlowRateStandardDeviation' REAL NULL, + 'UseForeshore' TINYINT (1) NOT NULL, -- true or false + 'DikeHeightCalculationType' TINYINT (1) NOT NULL, -- Enum: 1 = NoCalculation, 2 = CalculateByAssessmentSectionNorm, 3 = CalculateByProfileSpecificRequiredProbability + 'DikeHeight' REAL NULL, + 'UseBreakWater' TINYINT (1) NOT NULL, -- true or false + 'BreakWaterType' TINYINT (1) NOT NULL, -- Enum: 1 = Wall, 2 = Caisson, 3 = Dam + 'BreakWaterHeight' REAL NULL, + 'OvertoppingRateCalculationType' TINYINT (1) NOT NULL, -- Enum: 1 = NoCalculation, 2 = CalculateByAssessmentSectionNorm, 3 = CalculateByProfileSpecificRequiredProbability + 'ShouldDikeHeightIllustrationPointsBeCalculated' TINYINT (1) NOT NULL, -- true or false + 'ShouldOvertoppingRateIllustrationPointsBeCalculated' TINYINT (1) NOT NULL, -- true or false + 'ShouldOvertoppingOutputIllustrationPointsBeCalculated' TINYINT (1) NOT NULL, -- true or false + 'RelevantForScenario' TINYINT (1) NOT NULL, -- true or false + 'ScenarioContribution' REAL NOT NULL, + CONSTRAINT 'FK_GrassCoverErosionInwardsCalculationEntity_CalculationGroupEntity' FOREIGN KEY ('CalculationGroupEntityId') REFERENCES 'CalculationGroupEntity' ('CalculationGroupEntityId') ON DELETE Cascade ON UPDATE Cascade, + CONSTRAINT 'FK_GrassCoverErosionInwardsCalculationEntity_DikeProfileEntity' FOREIGN KEY ('DikeProfileEntityId') REFERENCES 'DikeProfileEntity' ('DikeProfileEntityId') ON DELETE Set Null ON UPDATE Cascade, + CONSTRAINT 'FK_GrassCoverErosionInwardsCalculationEntity_HydraulicLocationEntity' FOREIGN KEY ('HydraulicLocationEntityId') REFERENCES 'HydraulicLocationEntity' ('HydraulicLocationEntityId') ON DELETE Set Null ON UPDATE Cascade +) +; + +CREATE TABLE 'GrassCoverErosionOutwardsFailureMechanismMetaEntity' +( + 'GrassCoverErosionOutwardsFailureMechanismMetaEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'FailureMechanismEntityId' INTEGER NOT NULL, + 'HydraulicLocationCalculationCollectionEntity1Id' INTEGER NOT NULL, -- Represents the design water level failure mechanism specific factorized signaling norm + 'HydraulicLocationCalculationCollectionEntity2Id' INTEGER NOT NULL, -- Represents the design water level failure mechanism specific signaling norm + 'HydraulicLocationCalculationCollectionEntity3Id' INTEGER NOT NULL, -- Represents the design water level failure mechanism specific lower limit norm + 'HydraulicLocationCalculationCollectionEntity4Id' INTEGER NOT NULL, -- Represents the wave height failure mechanism specific factorized signaling norm + 'HydraulicLocationCalculationCollectionEntity5Id' INTEGER NOT NULL, -- Represents the wave height failure mechanism specific signaling norm + 'HydraulicLocationCalculationCollectionEntity6Id' INTEGER NOT NULL, -- Represents the wave height failure mechanism specific lower limit norm + 'N' REAL NOT NULL, + 'ForeshoreProfileCollectionSourcePath' TEXT NULL, + CONSTRAINT 'FK_GrassCoverErosionOutwardsFailureMechanismMetaEntity_FailureMechanismEntity' FOREIGN KEY ('FailureMechanismEntityId') REFERENCES 'FailureMechanismEntity' ('FailureMechanismEntityId') ON DELETE Cascade ON UPDATE Cascade, + CONSTRAINT 'FK_GrassCoverErosionOutwardsFailureMechanismMetaEntity_HydraulicLocationCalculationCollectionEntity1' FOREIGN KEY ('HydraulicLocationCalculationCollectionEntity1Id') REFERENCES 'HydraulicLocationCalculationCollectionEntity' ('HydraulicLocationCalculationCollectionEntityId') ON DELETE No Action ON UPDATE Cascade, + CONSTRAINT 'FK_GrassCoverErosionOutwardsFailureMechanismMetaEntity_HydraulicLocationCalculationCollectionEntity2' FOREIGN KEY ('HydraulicLocationCalculationCollectionEntity2Id') REFERENCES 'HydraulicLocationCalculationCollectionEntity' ('HydraulicLocationCalculationCollectionEntityId') ON DELETE No Action ON UPDATE Cascade, + CONSTRAINT 'FK_GrassCoverErosionOutwardsFailureMechanismMetaEntity_HydraulicLocationCalculationCollectionEntity3' FOREIGN KEY ('HydraulicLocationCalculationCollectionEntity3Id') REFERENCES 'HydraulicLocationCalculationCollectionEntity' ('HydraulicLocationCalculationCollectionEntityId') ON DELETE No Action ON UPDATE Cascade, + CONSTRAINT 'FK_GrassCoverErosionOutwardsFailureMechanismMetaEntity_HydraulicLocationCalculationCollectionEntity4' FOREIGN KEY ('HydraulicLocationCalculationCollectionEntity4Id') REFERENCES 'HydraulicLocationCalculationCollectionEntity' ('HydraulicLocationCalculationCollectionEntityId') ON DELETE No Action ON UPDATE Cascade, + CONSTRAINT 'FK_GrassCoverErosionOutwardsFailureMechanismMetaEntity_HydraulicLocationCalculationCollectionEntity5' FOREIGN KEY ('HydraulicLocationCalculationCollectionEntity5Id') REFERENCES 'HydraulicLocationCalculationCollectionEntity' ('HydraulicLocationCalculationCollectionEntityId') ON DELETE No Action ON UPDATE Cascade, + CONSTRAINT 'FK_GrassCoverErosionOutwardsFailureMechanismMetaEntity_HydraulicLocationCalculationCollectionEntity6' FOREIGN KEY ('HydraulicLocationCalculationCollectionEntity6Id') REFERENCES 'HydraulicLocationCalculationCollectionEntity' ('HydraulicLocationCalculationCollectionEntityId') ON DELETE No Action ON UPDATE Cascade, + CONSTRAINT 'U_HydraulicLocationCalculationCollectionEntity1Id' UNIQUE ('HydraulicLocationCalculationCollectionEntity1Id'), + CONSTRAINT 'U_HydraulicLocationCalculationCollectionEntity2Id' UNIQUE ('HydraulicLocationCalculationCollectionEntity2Id'), + CONSTRAINT 'U_HydraulicLocationCalculationCollectionEntity3Id' UNIQUE ('HydraulicLocationCalculationCollectionEntity3Id'), + CONSTRAINT 'U_HydraulicLocationCalculationCollectionEntity4Id' UNIQUE ('HydraulicLocationCalculationCollectionEntity4Id'), + CONSTRAINT 'U_HydraulicLocationCalculationCollectionEntity5Id' UNIQUE ('HydraulicLocationCalculationCollectionEntity5Id'), + CONSTRAINT 'U_HydraulicLocationCalculationCollectionEntity6Id' UNIQUE ('HydraulicLocationCalculationCollectionEntity6Id') +) +; + +CREATE TABLE 'PipingSoilLayerEntity' +( + 'PipingSoilLayerEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'PipingSoilProfileEntityId' INTEGER NOT NULL, + 'Top' REAL NULL, + 'IsAquifer' TINYINT (1) NOT NULL, -- true or false + 'Color' INTEGER NULL, -- ARGB value of Color. + 'MaterialName' TEXT NOT NULL, + 'BelowPhreaticLevelMean' REAL NULL, + 'BelowPhreaticLevelDeviation' REAL NULL, + 'BelowPhreaticLevelShift' REAL NULL, + 'DiameterD70Mean' REAL NULL, + 'DiameterD70CoefficientOfVariation' REAL NULL, + 'PermeabilityMean' REAL NULL, + 'PermeabilityCoefficientOfVariation' REAL NULL, + 'Order' INT (4) NOT NULL, + CONSTRAINT 'FK_PipingSoilLayerEntity_SoilProfileEntity' FOREIGN KEY ('PipingSoilProfileEntityId') REFERENCES 'PipingSoilProfileEntity' ('PipingSoilProfileEntityId') ON DELETE Cascade ON UPDATE Cascade +) +; + +CREATE TABLE 'PipingSoilProfileEntity' +( + 'PipingSoilProfileEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'Bottom' REAL NULL, + 'Name' TEXT NOT NULL, + 'SourceType' TINYINT (1) NOT NULL -- Enum: 1 = SoilProfile1D, 2 = SoilProfile2D +) +; + +CREATE TABLE 'PipingStochasticSoilProfileEntity' +( + 'PipingStochasticSoilProfileEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'PipingSoilProfileEntityId' INTEGER NOT NULL, + 'StochasticSoilModelEntityId' INTEGER NOT NULL, + 'Probability' REAL NOT NULL, + 'Order' INT (4) NOT NULL, + CONSTRAINT 'FK_PipingStochasticSoilProfileEntity_SoilProfileEntity' FOREIGN KEY ('PipingSoilProfileEntityId') REFERENCES 'PipingSoilProfileEntity' ('PipingSoilProfileEntityId') ON DELETE Cascade ON UPDATE Cascade, + CONSTRAINT 'FK_PipingStochasticSoilProfileEntity_StochasticSoilModelEntity' FOREIGN KEY ('StochasticSoilModelEntityId') REFERENCES 'StochasticSoilModelEntity' ('StochasticSoilModelEntityId') ON DELETE Cascade ON UPDATE Cascade +) +; + +CREATE TABLE 'StochasticSoilModelEntity' +( + 'StochasticSoilModelEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'FailureMechanismEntityId' INTEGER NOT NULL, + 'Name' TEXT NOT NULL, + 'StochasticSoilModelSegmentPointXml' TEXT NOT NULL, + 'Order' INT (4) NOT NULL, + CONSTRAINT 'FK_StochasticSoilModelEntity_FailureMechanismEntity' FOREIGN KEY ('FailureMechanismEntityId') REFERENCES 'FailureMechanismEntity' ('FailureMechanismEntityId') ON DELETE Cascade ON UPDATE Cascade, + CONSTRAINT 'UQ_StochasticSoilModelEntity_NameFailureMechanismEntityId' UNIQUE ('Name','FailureMechanismEntityId') +) +; + +CREATE TABLE 'SurfaceLineEntity' +( + 'SurfaceLineEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'FailureMechanismEntityId' INTEGER NOT NULL, + 'Name' VARCHAR (260) NOT NULL, + 'ReferenceLineIntersectionX' REAL NULL, + 'ReferenceLineIntersectionY' REAL NULL, + 'PointsXml' TEXT NOT NULL, + 'Order' INT (4) NOT NULL, + CONSTRAINT 'FK_SurfaceLineEntity_FailureMechanismEntity' FOREIGN KEY ('FailureMechanismEntityId') REFERENCES 'FailureMechanismEntity' ('FailureMechanismEntityId') ON DELETE Cascade ON UPDATE Cascade, + CONSTRAINT 'UQ_SurfaceLineEntity_NameFailureMechanismEntityId' UNIQUE ('Name','FailureMechanismEntityId') +) +; + +CREATE TABLE 'PipingCharacteristicPointEntity' +( + 'PipingCharacteristicPointEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'SurfaceLineEntityId' INTEGER NOT NULL, + 'Type' TINYINT (1) NOT NULL, -- Enum: 1 = DikeToeAtRiver, 2 = DikeToeAtPolder, 3 = DitchDikeSide, 4 = BottomDitchDikeSide, 5 = BottomDitchPolderSide, 6 = DitchPolderSide + 'X' REAL NULL, + 'Y' REAL NULL, + 'Z' REAL NULL, + CONSTRAINT 'FK_SurfaceLinePointEntity_SurfaceLineEntity' FOREIGN KEY ('SurfaceLineEntityId') REFERENCES 'SurfaceLineEntity' ('SurfaceLineEntityId') ON DELETE Cascade ON UPDATE Cascade +) +; + +CREATE TABLE 'WaveImpactAsphaltCoverFailureMechanismMetaEntity' +( + 'WaveImpactAsphaltCoverFailureMechanismMetaEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'FailureMechanismEntityId' INTEGER NOT NULL, + 'ForeshoreProfileCollectionSourcePath' TEXT NULL, + 'DeltaL' REAL NOT NULL, + CONSTRAINT 'FK_WaveImpactAsphaltCoverFailureMechanismMetaEntity_FailureMechanismEntity' FOREIGN KEY ('FailureMechanismEntityId') REFERENCES 'FailureMechanismEntity' ('FailureMechanismEntityId') ON DELETE Cascade ON UPDATE Cascade +) +; + +CREATE TABLE 'BackgroundDataEntity' +( + 'BackgroundDataEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'AssessmentSectionEntityId' INTEGER NOT NULL, + 'Name' TEXT NOT NULL, + 'IsVisible' TINYINT (1) NOT NULL, -- true or false + 'Transparency' REAL NOT NULL, + 'BackgroundDataType' TINYINT (1) NOT NULL, -- Enum: 1 = Wmts, 2 = WellKnown + CONSTRAINT 'FK_BackgroundDataEntity_AssessmentSectionEntity' FOREIGN KEY ('AssessmentSectionEntityId') REFERENCES 'AssessmentSectionEntity' ('AssessmentSectionEntityId') ON DELETE Cascade ON UPDATE Cascade +) +; + +CREATE TABLE 'BackgroundDataMetaEntity' +( + 'BackgroundDataMetaEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'BackgroundDataEntityId' INTEGER NOT NULL, + 'Key' TEXT NOT NULL, + 'Value' TEXT NOT NULL, + CONSTRAINT 'FK_BackgroundDataMetaEntity_BackgroundDataEntity' FOREIGN KEY ('BackgroundDataEntityId') REFERENCES 'BackgroundDataEntity' ('BackgroundDataEntityId') ON DELETE Cascade ON UPDATE Cascade, + CONSTRAINT 'U_BackgroundDataEntityId_Key' UNIQUE ('BackgroundDataEntityId','Key') +) +; + +CREATE TABLE 'ClosingStructureEntity' +( + 'ClosingStructureEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'FailureMechanismEntityId' INTEGER NOT NULL, + 'Order' INT (4) NOT NULL, + 'Name' VARCHAR (260) NOT NULL, + 'Id' VARCHAR (260) NOT NULL, + 'X' REAL NULL, + 'Y' REAL NULL, + 'StructureNormalOrientation' REAL NULL, + 'StorageStructureAreaMean' REAL NULL, + 'StorageStructureAreaCoefficientOfVariation' REAL NULL, + 'AllowedLevelIncreaseStorageMean' REAL NULL, + 'AllowedLevelIncreaseStorageStandardDeviation' REAL NULL, + 'WidthFlowAperturesMean' REAL NULL, + 'WidthFlowAperturesStandardDeviation' REAL NULL, + 'LevelCrestStructureNotClosingMean' REAL NULL, + 'LevelCrestStructureNotClosingStandardDeviation' REAL NULL, + 'InsideWaterLevelMean' REAL NULL, + 'InsideWaterLevelStandardDeviation' REAL NULL, + 'ThresholdHeightOpenWeirMean' REAL NULL, + 'ThresholdHeightOpenWeirStandardDeviation' REAL NULL, + 'AreaFlowAperturesMean' REAL NULL, + 'AreaFlowAperturesStandardDeviation' REAL NULL, + 'CriticalOvertoppingDischargeMean' REAL NULL, + 'CriticalOvertoppingDischargeCoefficientOfVariation' REAL NULL, + 'FlowWidthAtBottomProtectionMean' REAL NULL, + 'FlowWidthAtBottomProtectionStandardDeviation' REAL NULL, + 'ProbabilityOpenStructureBeforeFlooding' REAL NULL, + 'FailureProbabilityOpenStructure' REAL NULL, + 'IdenticalApertures' INT (4) NOT NULL, + 'FailureProbabilityReparation' REAL NULL, + 'InflowModelType' TINYINT (1) NOT NULL, -- Enum: 1 = VerticalWall, 2 = LowSill, 3 = FloodedCulvert + CONSTRAINT 'FK_ClosingStructureEntity_FailureMechanismEntity' FOREIGN KEY ('FailureMechanismEntityId') REFERENCES 'FailureMechanismEntity' ('FailureMechanismEntityId') ON DELETE Cascade ON UPDATE Cascade, + CONSTRAINT 'U_Id_FailureMechanismEntityId' UNIQUE ('FailureMechanismEntityId','Id') +) +; + +CREATE TABLE 'ClosingStructuresCalculationEntity' +( + 'ClosingStructuresCalculationEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'CalculationGroupEntityId' INTEGER NOT NULL, + 'ForeshoreProfileEntityId' INTEGER NULL, + 'HydraulicLocationEntityId' INTEGER NULL, + 'ClosingStructureEntityId' INTEGER NULL, + 'Order' INT (4) NOT NULL, + 'Name' VARCHAR (255) NULL, + 'Comments' TEXT NULL, + 'UseBreakWater' TINYINT (1) NOT NULL, -- true or false + 'BreakWaterType' TINYINT (1) NOT NULL, -- Enum: 1 = Wall, 2 = Caisson, 3 = Dam + 'BreakWaterHeight' REAL NULL, + 'UseForeshore' TINYINT (1) NOT NULL, -- true or false + 'Orientation' REAL NULL, + 'StructureNormalOrientation' REAL NULL, + 'StorageStructureAreaMean' REAL NULL, + 'StorageStructureAreaCoefficientOfVariation' REAL NULL, + 'AllowedLevelIncreaseStorageMean' REAL NULL, + 'AllowedLevelIncreaseStorageStandardDeviation' REAL NULL, + 'WidthFlowAperturesMean' REAL NULL, + 'WidthFlowAperturesStandardDeviation' REAL NULL, + 'LevelCrestStructureNotClosingMean' REAL NULL, + 'LevelCrestStructureNotClosingStandardDeviation' REAL NULL, + 'InsideWaterLevelMean' REAL NULL, + 'InsideWaterLevelStandardDeviation' REAL NULL, + 'ThresholdHeightOpenWeirMean' REAL NULL, + 'ThresholdHeightOpenWeirStandardDeviation' REAL NULL, + 'AreaFlowAperturesMean' REAL NULL, + 'AreaFlowAperturesStandardDeviation' REAL NULL, + 'CriticalOvertoppingDischargeMean' REAL NULL, + 'CriticalOvertoppingDischargeCoefficientOfVariation' REAL NULL, + 'FlowWidthAtBottomProtectionMean' REAL NULL, + 'FlowWidthAtBottomProtectionStandardDeviation' REAL NULL, + 'ProbabilityOpenStructureBeforeFlooding' REAL NOT NULL, + 'FailureProbabilityOpenStructure' REAL NOT NULL, + 'IdenticalApertures' INT (4) NOT NULL, + 'FailureProbabilityReparation' REAL NOT NULL, + 'InflowModelType' TINYINT (1) NOT NULL, -- Enum: 1 = VerticalWall, 2 = LowSill, 3 = FloodedCulvert + 'FailureProbabilityStructureWithErosion' REAL NOT NULL, + 'DeviationWaveDirection' REAL NULL, + 'DrainCoefficientMean' REAL NULL, + 'DrainCoefficientStandardDeviation' REAL NULL, + 'ModelFactorSuperCriticalFlowMean' REAL NULL, + 'StormDurationMean' REAL NULL, + 'FactorStormDurationOpenStructure' REAL NULL, + 'ShouldIllustrationPointsBeCalculated' TINYINT (1) NOT NULL, -- true or false + 'RelevantForScenario' TINYINT (1) NOT NULL, -- true or false + 'ScenarioContribution' REAL NOT NULL, + CONSTRAINT 'FK_ClosingStructuresCalculationEntity_CalculationGroupEntity' FOREIGN KEY ('CalculationGroupEntityId') REFERENCES 'CalculationGroupEntity' ('CalculationGroupEntityId') ON DELETE Cascade ON UPDATE Cascade, + CONSTRAINT 'FK_ClosingStructuresCalculationEntity_ClosingStructureEntity' FOREIGN KEY ('ClosingStructureEntityId') REFERENCES 'ClosingStructureEntity' ('ClosingStructureEntityId') ON DELETE Set Null ON UPDATE Cascade, + CONSTRAINT 'FK_ClosingStructuresCalculationEntity_ForeshoreProfileEntity' FOREIGN KEY ('ForeshoreProfileEntityId') REFERENCES 'ForeshoreProfileEntity' ('ForeshoreProfileEntityId') ON DELETE Set Null ON UPDATE Cascade, + CONSTRAINT 'FK_ClosingStructuresCalculationEntity_HydraulicLocationEntity' FOREIGN KEY ('HydraulicLocationEntityId') REFERENCES 'HydraulicLocationEntity' ('HydraulicLocationEntityId') ON DELETE Set Null ON UPDATE Cascade +) +; + +CREATE TABLE 'ClosingStructuresOutputEntity' +( + 'ClosingStructuresOutputEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'ClosingStructuresCalculationEntityId' INTEGER NOT NULL, + 'GeneralResultFaultTreeIllustrationPointEntityId' INTEGER NULL, + 'Reliability' REAL NULL, + CONSTRAINT 'FK_ClosingStructuresOutputEntity_ClosingStructuresCalculationEntity' FOREIGN KEY ('ClosingStructuresCalculationEntityId') REFERENCES 'ClosingStructuresCalculationEntity' ('ClosingStructuresCalculationEntityId') ON DELETE Cascade ON UPDATE Cascade, + CONSTRAINT 'FK_ClosingStructuresOutputEntity_GeneralResultFaultTreeIllustrationPointEntity' FOREIGN KEY ('GeneralResultFaultTreeIllustrationPointEntityId') REFERENCES 'GeneralResultFaultTreeIllustrationPointEntity' ('GeneralResultFaultTreeIllustrationPointEntityId') ON DELETE Set Null ON UPDATE Cascade, + CONSTRAINT 'U_ClosingStructuresCalculationEntity' UNIQUE ('ClosingStructuresCalculationEntityId') +) +; + +CREATE TABLE 'ClosingStructuresSectionResultEntity' +( + 'ClosingStructuresSectionResultEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'FailureMechanismSectionEntityId' INTEGER NOT NULL, + 'SimpleAssessmentResult' TINYINT (1) NOT NULL, -- Enum: 1 = None, 2 = NotApplicable, 3 = ProbabilityNegligible, 4 = AssessFurther + 'DetailedAssessmentResult' TINYINT (1) NOT NULL, -- Enum: 1 = Probability, 2 = NotAssessed + 'TailorMadeAssessmentResult' TINYINT (1) NOT NULL, -- Enum: 1 = None, 2 = ProbabilityNegligible, 3 = Probability, 4 = NotAssessed + 'TailorMadeAssessmentProbability' REAL NULL, + 'UseManualAssembly' TINYINT (1) NOT NULL, -- true or false + 'ManualAssemblyProbability' REAL NULL, + CONSTRAINT 'FK_ClosingStructuresSectionResultEntity_FailureMechanismSectionEntity' FOREIGN KEY ('FailureMechanismSectionEntityId') REFERENCES 'FailureMechanismSectionEntity' ('FailureMechanismSectionEntityId') ON DELETE Cascade ON UPDATE Cascade +) +; + +CREATE TABLE 'DikeProfileEntity' +( + 'DikeProfileEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'FailureMechanismEntityId' INTEGER NOT NULL, + 'Id' VARCHAR (260) NOT NULL, + 'Name' VARCHAR (260) NOT NULL, + 'Orientation' REAL NULL, + 'BreakWaterType' TINYINT (1) NULL, -- Enum: 1 = Wall 2 = Caisson 3 = Dam + 'BreakWaterHeight' REAL NULL, + 'ForeshoreXml' TEXT NOT NULL, + 'DikeGeometryXml' TEXT NOT NULL, + 'DikeHeight' REAL NULL, + 'X' REAL NULL, + 'Y' REAL NULL, + 'X0' REAL NULL, + 'Order' INT (4) NOT NULL, + CONSTRAINT 'FK_DikeProfileEntity_FailureMechanismEntity' FOREIGN KEY ('FailureMechanismEntityId') REFERENCES 'FailureMechanismEntity' ('FailureMechanismEntityId') ON DELETE Cascade ON UPDATE Cascade, + CONSTRAINT 'UQ_DikeProfileEntity_IdFailureMechanismEntityId' UNIQUE ('Id','FailureMechanismEntityId') +) +; + +CREATE TABLE 'DuneErosionFailureMechanismMetaEntity' +( + 'DuneErosionFailureMechanismMetaEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'FailureMechanismEntityId' INTEGER NOT NULL, + 'DuneLocationCalculationCollectionEntity1Id' INTEGER NOT NULL, -- Represents the calculations for the failure mechanism specific factorized signaling norm + 'DuneLocationCalculationCollectionEntity2Id' INTEGER NOT NULL, -- Represents the calculations for the failure mechanism specific signaling norm + 'DuneLocationCalculationCollectionEntity3Id' INTEGER NOT NULL, -- Represents the calculations for the failure mechanism specific lower limit norm + 'DuneLocationCalculationCollectionEntity4Id' INTEGER NOT NULL, -- Represents the calculations for the lower limit norm + 'DuneLocationCalculationCollectionEntity5Id' INTEGER NOT NULL, -- Represents the calculations for the factorized lower limit norm + 'N' REAL NOT NULL, + CONSTRAINT 'FK_DuneErosionFailureMechanismMetaEntity_DuneLocationCalculationCollectionEntity1' FOREIGN KEY ('DuneLocationCalculationCollectionEntity1Id') REFERENCES 'DuneLocationCalculationCollectionEntity' ('DuneLocationCalculationCollectionEntityId') ON DELETE No Action ON UPDATE Cascade, + CONSTRAINT 'FK_DuneErosionFailureMechanismMetaEntity_DuneLocationCalculationCollectionEntity2' FOREIGN KEY ('DuneLocationCalculationCollectionEntity2Id') REFERENCES 'DuneLocationCalculationCollectionEntity' ('DuneLocationCalculationCollectionEntityId') ON DELETE No Action ON UPDATE Cascade, + CONSTRAINT 'FK_DuneErosionFailureMechanismMetaEntity_DuneLocationCalculationCollectionEntity3' FOREIGN KEY ('DuneLocationCalculationCollectionEntity3Id') REFERENCES 'DuneLocationCalculationCollectionEntity' ('DuneLocationCalculationCollectionEntityId') ON DELETE No Action ON UPDATE Cascade, + CONSTRAINT 'FK_DuneErosionFailureMechanismMetaEntity_DuneLocationCalculationCollectionEntity4' FOREIGN KEY ('DuneLocationCalculationCollectionEntity4Id') REFERENCES 'DuneLocationCalculationCollectionEntity' ('DuneLocationCalculationCollectionEntityId') ON DELETE No Action ON UPDATE Cascade, + CONSTRAINT 'FK_DuneErosionFailureMechanismMetaEntity_DuneLocationCalculationCollectionEntity5' FOREIGN KEY ('DuneLocationCalculationCollectionEntity5Id') REFERENCES 'DuneLocationCalculationCollectionEntity' ('DuneLocationCalculationCollectionEntityId') ON DELETE No Action ON UPDATE Cascade, + CONSTRAINT 'FK_DuneErosionFailureMechanismMetaEntity_FailureMechanismEntity' FOREIGN KEY ('FailureMechanismEntityId') REFERENCES 'FailureMechanismEntity' ('FailureMechanismEntityId') ON DELETE Cascade ON UPDATE Cascade +) +; + +CREATE TABLE 'DuneErosionSectionResultEntity' +( + 'DuneErosionSectionResultEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'FailureMechanismSectionEntityId' INTEGER NOT NULL, + 'SimpleAssessmentResult' TINYINT (1) NOT NULL, -- Enum: 1 = None, 2 = NotApplicable, 3 = Applicable + 'DetailedAssessmentResultForFactorizedSignalingNorm' TINYINT (1) NOT NULL, -- Enum: 1 = None, 2 = Sufficient 3 = Insufficient, 4 = NotAssessed + 'DetailedAssessmentResultForSignalingNorm' TINYINT (1) NOT NULL, -- Enum: 1 = None, 2 = Sufficient 3 = Insufficient, 4 = NotAssessed + 'DetailedAssessmentResultForMechanismSpecificLowerLimitNorm' TINYINT (1) NOT NULL, -- Enum: 1 = None, 2 = Sufficient 3 = Insufficient, 4 = NotAssessed + 'DetailedAssessmentResultForLowerLimitNorm' TINYINT (1) NOT NULL, -- Enum: 1 = None, 2 = Sufficient 3 = Insufficient, 4 = NotAssessed + 'DetailedAssessmentResultForFactorizedLowerLimitNorm' TINYINT (1) NOT NULL, -- Enum: 1 = None, 2 = Sufficient 3 = Insufficient, 4 = NotAssessed + 'TailorMadeAssessmentResult' TINYINT (1) NOT NULL, -- Enum: 1 = None, 2 = Iv, 3 = IIv, 4 = IIIv, 5 = IVv, 6 = Vv, 7 = VIv, 8 = VIIv + 'UseManualAssembly' TINYINT (1) NOT NULL, -- true or false + 'ManualAssemblyCategoryGroup' TINYINT (1) NOT NULL, -- Enum: 1 = None, 2 = NotApplicable 3 = Iv, 4 = IIv, 5 = IIIv, 6 = IVv, 7 = Vv, 8 = VIv, 9 = VIIv + CONSTRAINT 'FK_DuneErosionSectionResultEntity_FailureMechanismSectionEntity' FOREIGN KEY ('FailureMechanismSectionEntityId') REFERENCES 'FailureMechanismSectionEntity' ('FailureMechanismSectionEntityId') ON DELETE Cascade ON UPDATE Cascade +) +; + +CREATE TABLE 'DuneLocationCalculationCollectionEntity' +( + 'DuneLocationCalculationCollectionEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT +) +; + +CREATE TABLE 'DuneLocationCalculationEntity' +( + 'DuneLocationCalculationEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'DuneLocationEntityId' INTEGER NULL, + 'DuneLocationCalculationCollectionEntityId' INTEGER NULL, + CONSTRAINT 'FK_DuneLocationCalculationEntity_DuneLocationCalculationCollectionEntity' FOREIGN KEY ('DuneLocationCalculationCollectionEntityId') REFERENCES 'DuneLocationCalculationCollectionEntity' ('DuneLocationCalculationCollectionEntityId') ON DELETE Cascade ON UPDATE Cascade, + CONSTRAINT 'FK_DuneLocationCalculationEntity_DuneLocationEntity' FOREIGN KEY ('DuneLocationEntityId') REFERENCES 'DuneLocationEntity' ('DuneLocationEntityId') ON DELETE Cascade ON UPDATE Cascade +) +; + +CREATE TABLE 'DuneLocationCalculationOutputEntity' +( + 'DuneLocationCalculationOutputEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'DuneLocationCalculationEntityId' INTEGER NOT NULL, + 'WaterLevel' REAL NULL, + 'WaveHeight' REAL NULL, + 'WavePeriod' REAL NULL, + 'TargetProbability' REAL NULL, + 'TargetReliability' REAL NULL, + 'CalculatedProbability' REAL NULL, + 'CalculatedReliability' REAL NULL, + 'CalculationConvergence' TINYINT (1) NOT NULL, -- Enum: 1 = NotCalculated, 2 = CalculatedNotConverged, 3 = CalculatedConverged + CONSTRAINT 'FK_DuneLocationCalculationOutputEntity_DuneLocationCalculationEntity' FOREIGN KEY ('DuneLocationCalculationEntityId') REFERENCES 'DuneLocationCalculationEntity' ('DuneLocationCalculationEntityId') ON DELETE Cascade ON UPDATE Cascade +) +; + +CREATE TABLE 'DuneLocationEntity' +( + 'DuneLocationEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'FailureMechanismEntityId' INTEGER NOT NULL, + 'LocationId' INTEGER NOT NULL, + 'Name' VARCHAR (260) NOT NULL, + 'LocationX' REAL NULL, + 'LocationY' REAL NULL, + 'CoastalAreaId' INT (4) NOT NULL, + 'Offset' REAL NULL, + 'Orientation' REAL NULL, + 'D50' REAL NULL, + 'Order' INT (4) NOT NULL, + CONSTRAINT 'FK_DuneLocationEntity_FailureMechanismEntity' FOREIGN KEY ('FailureMechanismEntityId') REFERENCES 'FailureMechanismEntity' ('FailureMechanismEntityId') ON DELETE Cascade ON UPDATE Cascade +) +; + +CREATE TABLE 'FaultTreeIllustrationPointEntity' +( + 'FaultTreeIllustrationPointEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'ParentFaultTreeIllustrationPointEntityId' INTEGER NULL, + 'Name' TEXT NOT NULL, + 'Beta' REAL NOT NULL, + 'CombinationType' TINYINT (1) NOT NULL, -- Enum: 1 = Or, 2 = And + 'Order' INT (4) NOT NULL, + CONSTRAINT 'FK_FaultTreeIllustrationPoint_FaultTreeIllustrationPoint' FOREIGN KEY ('ParentFaultTreeIllustrationPointEntityId') REFERENCES 'FaultTreeIllustrationPointEntity' ('FaultTreeIllustrationPointEntityId') ON DELETE Cascade ON UPDATE Cascade +) +; + +CREATE TABLE 'FaultTreeIllustrationPointStochastEntity' +( + 'FaultTreeIllustrationPointEntityId' INTEGER NOT NULL, + 'StochastEntityId' INTEGER NOT NULL, + CONSTRAINT 'PK_FaultTreeIllustrationPointStochastEntity' PRIMARY KEY ('FaultTreeIllustrationPointEntityId','StochastEntityId'), + CONSTRAINT 'FK_FaultTreeIllustrationPointStochastEntity_FaultTreeIllustrationPoint' FOREIGN KEY ('FaultTreeIllustrationPointEntityId') REFERENCES 'FaultTreeIllustrationPointEntity' ('FaultTreeIllustrationPointEntityId') ON DELETE No Action ON UPDATE No Action, + CONSTRAINT 'FK_FaultTreeIllustrationPointStochastEntity_StochastEntity' FOREIGN KEY ('StochastEntityId') REFERENCES 'StochastEntity' ('StochastEntityId') ON DELETE Cascade ON UPDATE Cascade +) +; + +CREATE TABLE 'FaultTreeSubmechanismIllustrationPointEntity' +( + 'SubMechanismIllustrationPointEntityId' INTEGER NOT NULL, + 'FaultTreeIllustrationPointEntityId' INTEGER NOT NULL, + CONSTRAINT 'PK_FaultTreeSubMechanismIllustrationPointEntityId' PRIMARY KEY ('SubMechanismIllustrationPointEntityId','FaultTreeIllustrationPointEntityId'), + CONSTRAINT 'FK_FaultTreeIllustrationPointEntity_FaultTreeIllustrationPointEntity' FOREIGN KEY ('FaultTreeIllustrationPointEntityId') REFERENCES 'FaultTreeIllustrationPointEntity' ('FaultTreeIllustrationPointEntityId') ON DELETE Cascade ON UPDATE Cascade, + CONSTRAINT 'FK_FaultTreeIllustrationPointEntity_SubMechanismIllustrationPointEntity' FOREIGN KEY ('SubMechanismIllustrationPointEntityId') REFERENCES 'SubMechanismIllustrationPointEntity' ('SubMechanismIllustrationPointEntityId') ON DELETE Cascade ON UPDATE Cascade +) +; + +CREATE TABLE 'ForeshoreProfileEntity' +( + 'ForeshoreProfileEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'FailureMechanismEntityId' INTEGER NOT NULL, + 'Id' VARCHAR (260) NOT NULL, + 'Name' VARCHAR (260) NOT NULL, + 'Orientation' REAL NULL, + 'BreakWaterType' TINYINT (1) NULL, -- Enum: 1 = Wall, 2 = Caisson, 3 = Dam + 'BreakWaterHeight' REAL NULL, + 'GeometryXml' TEXT NOT NULL, + 'X' REAL NULL, + 'Y' REAL NULL, + 'X0' REAL NULL, + 'Order' INT (4) NOT NULL, + CONSTRAINT 'FK_ForeshoreProfileEntity_FailureMechanismEntity' FOREIGN KEY ('FailureMechanismEntityId') REFERENCES 'FailureMechanismEntity' ('FailureMechanismEntityId') ON DELETE Cascade ON UPDATE Cascade, + CONSTRAINT 'UQ_ForeshoreProfileEntity_IdFailureMechanismEntityId' UNIQUE ('Id','FailureMechanismEntityId') +) +; + +CREATE TABLE 'GeneralResultFaultTreeIllustrationPointEntity' +( + 'GeneralResultFaultTreeIllustrationPointEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'GoverningWindDirectionName' TEXT NOT NULL, + 'GoverningWindDirectionAngle' REAL NOT NULL +) +; + +CREATE TABLE 'GeneralResultFaultTreeIllustrationPointStochastEntity' +( + 'GeneralResultFaultTreeIllustrationPointEntityId' INTEGER NOT NULL, + 'StochastEntityId' INTEGER NOT NULL, + CONSTRAINT 'PK_GeneralResultFaultTreeIllustrationPointStochastEntity' PRIMARY KEY ('GeneralResultFaultTreeIllustrationPointEntityId','StochastEntityId'), + CONSTRAINT 'FK_GeneralResultFaultTreeIllustrationPointStochastEntity_GeneralResultFaultTreeIllustrationPointEntity' FOREIGN KEY ('GeneralResultFaultTreeIllustrationPointEntityId') REFERENCES 'GeneralResultFaultTreeIllustrationPointEntity' ('GeneralResultFaultTreeIllustrationPointEntityId') ON DELETE Cascade ON UPDATE Cascade, + CONSTRAINT 'FK_GeneralResultFaultTreeIllustrationPointStochastEntity_StochastEntity' FOREIGN KEY ('StochastEntityId') REFERENCES 'StochastEntity' ('StochastEntityId') ON DELETE Cascade ON UPDATE Cascade +) +; + +CREATE TABLE 'GeneralResultSubMechanismIllustrationPointEntity' +( + 'GeneralResultSubMechanismIllustrationPointEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'GoverningWindDirectionName' TEXT NOT NULL, + 'GoverningWindDirectionAngle' REAL NOT NULL +) +; + +CREATE TABLE 'GeneralResultSubMechanismIllustrationPointStochastEntity' +( + 'GeneralResultSubMechanismIllustrationPointEntityId' INTEGER NOT NULL, + 'StochastEntityId' INTEGER NOT NULL, + CONSTRAINT 'PK_GeneralResultSubMechanismIllustrationPointStochastEntity' PRIMARY KEY ('GeneralResultSubMechanismIllustrationPointEntityId','StochastEntityId'), + CONSTRAINT 'FK_GeneralResultSubMechanisIllustrationPointStochastEntity_GeneralResultSubMechanismIllustrationPointEntity' FOREIGN KEY ('GeneralResultSubMechanismIllustrationPointEntityId') REFERENCES 'GeneralResultSubMechanismIllustrationPointEntity' ('GeneralResultSubMechanismIllustrationPointEntityId') ON DELETE Cascade ON UPDATE Cascade, + CONSTRAINT 'FK_GeneralResultSubMechanismIllustrationPointStochastEntity_StochastEntity' FOREIGN KEY ('StochastEntityId') REFERENCES 'StochastEntity' ('StochastEntityId') ON DELETE Cascade ON UPDATE Cascade +) +; + +CREATE TABLE 'GrassCoverErosionInwardsDikeHeightOutputEntity' +( + 'GrassCoverErosionInwardsDikeHeightOutputEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'GrassCoverErosionInwardsOutputEntityId' INTEGER NOT NULL, + 'GeneralResultFaultTreeIllustrationPointEntityId' INTEGER NULL, + 'DikeHeight' REAL NULL, + 'TargetProbability' REAL NULL, + 'TargetReliability' REAL NULL, + 'CalculatedProbability' REAL NULL, + 'CalculatedReliability' REAL NULL, + 'CalculationConvergence' TINYINT (1) NOT NULL, -- Enum: 1 = NotCalculated, 2 = CalculationNotConverged, 3 = CalculationConverged + CONSTRAINT 'FK_GrassCoverErosionInwardsDikeHeightOutputEntity_GeneralResultFaultTreeIllustrationPointEntity' FOREIGN KEY ('GeneralResultFaultTreeIllustrationPointEntityId') REFERENCES 'GeneralResultFaultTreeIllustrationPointEntity' ('GeneralResultFaultTreeIllustrationPointEntityId') ON DELETE Set Null ON UPDATE Cascade, + CONSTRAINT 'FK_GrassCoverErosionInwardsDikeHeightOutputEntity_GrassCoverErosionInwardsOutputEntity' FOREIGN KEY ('GrassCoverErosionInwardsOutputEntityId') REFERENCES 'GrassCoverErosionInwardsOutputEntity' ('GrassCoverErosionInwardsOutputEntityId') ON DELETE Cascade ON UPDATE Cascade, + CONSTRAINT 'U_GrassCoverErosionInwardsOutputEntity' UNIQUE ('GrassCoverErosionInwardsOutputEntityId') +) +; + +CREATE TABLE 'GrassCoverErosionInwardsOutputEntity' +( + 'GrassCoverErosionInwardsOutputEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'GrassCoverErosionInwardsCalculationEntityId' INTEGER NOT NULL, + 'GeneralResultFaultTreeIllustrationPointEntityId' INTEGER NULL, + 'Order' INT (4) NOT NULL, + 'IsOvertoppingDominant' TINYINT (1) NOT NULL, -- true or false + 'WaveHeight' REAL NULL, + 'Reliability' REAL NULL, + CONSTRAINT 'FK_GrassCoverErosionInwardsOutputEntity_GeneralResultFaultTreeIllustrationPointEntity' FOREIGN KEY ('GeneralResultFaultTreeIllustrationPointEntityId') REFERENCES 'GeneralResultFaultTreeIllustrationPointEntity' ('GeneralResultFaultTreeIllustrationPointEntityId') ON DELETE Set Null ON UPDATE Cascade, + CONSTRAINT 'FK_GrassCoverErosionInwardsOutputEntity_GrassCoverErosionInwardsCalculationEntity' FOREIGN KEY ('GrassCoverErosionInwardsCalculationEntityId') REFERENCES 'GrassCoverErosionInwardsCalculationEntity' ('GrassCoverErosionInwardsCalculationEntityId') ON DELETE Cascade ON UPDATE Cascade, + CONSTRAINT 'U_GrassCoverErosionInwardsCalculationEntity' UNIQUE ('GrassCoverErosionInwardsCalculationEntityId') +) +; + +CREATE TABLE 'GrassCoverErosionInwardsOvertoppingRateOutputEntity' +( + 'GrassCoverErosionInwardsOvertoppingRateOutputEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'GrassCoverErosionInwardsOutputEntityId' INTEGER NOT NULL, + 'GeneralResultFaultTreeIllustrationPointEntityId' INTEGER NULL, + 'OvertoppingRate' REAL NULL, + 'TargetProbability' REAL NULL, + 'TargetReliability' REAL NULL, + 'CalculatedProbability' REAL NULL, + 'CalculatedReliability' REAL NULL, + 'CalculationConvergence' TINYINT (1) NOT NULL, -- Enum: 1 = NotCalculated, 2 = CalculationNotConverged, 3 = CalculationConverged + CONSTRAINT 'FK_GrassCoverErosionInwardsOvertoppingRateOutputEntity_GeneralResultFaultTreeIllustrationPointEntity' FOREIGN KEY ('GeneralResultFaultTreeIllustrationPointEntityId') REFERENCES 'GeneralResultFaultTreeIllustrationPointEntity' ('GeneralResultFaultTreeIllustrationPointEntityId') ON DELETE Set Null ON UPDATE Cascade, + CONSTRAINT 'FK_GrassCoverErosionInwardsOvertoppingRateOutputEntity_GrassCoverErosionInwardsOutputEntity' FOREIGN KEY ('GrassCoverErosionInwardsOutputEntityId') REFERENCES 'GrassCoverErosionInwardsOutputEntity' ('GrassCoverErosionInwardsOutputEntityId') ON DELETE Cascade ON UPDATE Cascade, + CONSTRAINT 'U_GrassCoverErosionInwardsOutputEntity' UNIQUE ('GrassCoverErosionInwardsOutputEntityId') +) +; + +CREATE TABLE 'GrassCoverErosionInwardsSectionResultEntity' +( + 'GrassCoverErosionInwardsSectionResultEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'FailureMechanismSectionEntityId' INTEGER NOT NULL, + 'SimpleAssessmentResult' TINYINT (1) NOT NULL, -- Enum: 1 = None, 2 = NotApplicable, 3 = Applicable + 'DetailedAssessmentResult' TINYINT (1) NOT NULL, -- Enum: 1 = Probability, 2 = NotAssessed + 'TailorMadeAssessmentResult' TINYINT (1) NOT NULL, -- Enum: 1 = None, 2 = ProbabilityNegligible, 3 = Probability, 4 = NotAssessed + 'TailorMadeAssessmentProbability' REAL NULL, + 'UseManualAssembly' TINYINT (1) NOT NULL, -- true or false + 'ManualAssemblyProbability' REAL NULL, + CONSTRAINT 'FK_GrassCoverErosionInwardsSectionResultEntity_FailureMechanismSectionEntity' FOREIGN KEY ('FailureMechanismSectionEntityId') REFERENCES 'FailureMechanismSectionEntity' ('FailureMechanismSectionEntityId') ON DELETE Cascade ON UPDATE Cascade +) +; + +CREATE TABLE 'GrassCoverErosionOutwardsSectionResultEntity' +( + 'GrassCoverErosionOutwardsSectionResultEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'FailureMechanismSectionEntityId' INTEGER NOT NULL, + 'SimpleAssessmentResult' TINYINT (1) NOT NULL, -- Enum: 1 = None, 2 = NotApplicable, 3 = ProbabilityNegligible, 4 = AssessFurther + 'DetailedAssessmentResultForFactorizedSignalingNorm' TINYINT (1) NOT NULL, -- Detailed result Enum: 1 = None, 2 = Sufficient, 3 = Insufficient, 4 = NotAssessed + 'DetailedAssessmentResultForSignalingNorm' TINYINT (1) NOT NULL, -- Detailed result Enum: 1 = None, 2 = Sufficient, 3 = Insufficient, 4 = NotAssessed + 'DetailedAssessmentResultForMechanismSpecificLowerLimitNorm' TINYINT (1) NOT NULL, -- Detailed result Enum: 1 = None, 2 = Sufficient, 3 = Insufficient, 4 = NotAssessed + 'DetailedAssessmentResultForLowerLimitNorm' TINYINT (1) NOT NULL, -- Detailed result Enum: 1 = None, 2 = Sufficient, 3 = Insufficient, 4 = NotAssessed + 'DetailedAssessmentResultForFactorizedLowerLimitNorm' TINYINT (1) NOT NULL, -- Detailed result Enum: 1 = None, 2 = Sufficient, 3 = Insufficient, 4 = NotAssessed + 'TailorMadeAssessmentResult' TINYINT (1) NOT NULL, -- Enum: 1 = None, 2 = Iv, 3 = IIv, 4 = IIIv, 5 = IVv, 6 = Vv, 7 = VIv, 8 = VIIv + 'UseManualAssembly' TINYINT (1) NOT NULL, -- true or false + 'ManualAssemblyCategoryGroup' TINYINT (1) NOT NULL, -- Enum: 1 = None, 2 = NotApplicable 3 = Iv, 4 = IIv, 5 = IIIv, 6 = IVv, 7 = Vv, 8 = VIv, 9 = VIIv + CONSTRAINT 'FK_GrassCoverErosionOutwardsSectionResultEntity_FailureMechanismSectionEntity' FOREIGN KEY ('FailureMechanismSectionEntityId') REFERENCES 'FailureMechanismSectionEntity' ('FailureMechanismSectionEntityId') ON DELETE Cascade ON UPDATE Cascade +) +; + +CREATE TABLE 'GrassCoverErosionOutwardsWaveConditionsCalculationEntity' +( + 'GrassCoverErosionOutwardsWaveConditionsCalculationEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'CalculationGroupEntityId' INTEGER NOT NULL, + 'ForeshoreProfileEntityId' INTEGER NULL, + 'HydraulicLocationEntityId' INTEGER NULL, + 'Order' INT (4) NOT NULL, + 'Name' VARCHAR (260) NULL, + 'Comments' TEXT NULL, + 'UseBreakWater' TINYINT (1) NOT NULL, -- true or false + 'BreakWaterType' TINYINT (1) NOT NULL, -- Enum: 1 = Wall, 2 = Caisson, 3 = Dam + 'BreakWaterHeight' REAL NULL, + 'UseForeshore' TINYINT (1) NOT NULL, -- true or false + 'Orientation' REAL NULL, + 'UpperBoundaryRevetment' REAL NULL, + 'LowerBoundaryRevetment' REAL NULL, + 'UpperBoundaryWaterLevels' REAL NULL, + 'LowerBoundaryWaterLevels' REAL NULL, + 'StepSize' TINYINT (1) NOT NULL, -- Enum: 1 = 0.5, 2 = 1.0, 3 = 2.0 + 'CategoryType' TINYINT (1) NOT NULL, -- Enum: 1 = MechanismSpecificFactorizedSignalingNorm, 2 = MechanismSpecificSignalingNorm, 3 = MechanismSpecificLowerLimitNorm, 4 = LowerLimitNorm, 5 = FactorizedLowerLimitNorm + 'CalculationType' TINYINT (1) NOT NULL, -- Enum: 1 = WaveRunUp 2 = WaveImpact 3 = WaveRunUpAndWaveImpact 4 = TailorMadeWaveImpact 5 = WaveRunUpAndTailorMadeWaveImpact 6 = All + CONSTRAINT 'FK_GrassCoverErosionOutwardsWaveConditionsCalculationEntity_CalculationGroupEntity' FOREIGN KEY ('CalculationGroupEntityId') REFERENCES 'CalculationGroupEntity' ('CalculationGroupEntityId') ON DELETE Cascade ON UPDATE Cascade, + CONSTRAINT 'FK_GrassCoverErosionOutwardsWaveConditionsCalculationEntity_ForeshoreProfileEntity' FOREIGN KEY ('ForeshoreProfileEntityId') REFERENCES 'ForeshoreProfileEntity' ('ForeshoreProfileEntityId') ON DELETE Set Null ON UPDATE Cascade, + CONSTRAINT 'FK_GrassCoverErosionOutwardsWaveConditionsCalculationEntity_HydraulicLocationEntity' FOREIGN KEY ('HydraulicLocationEntityId') REFERENCES 'HydraulicLocationEntity' ('HydraulicLocationEntityId') ON DELETE Set Null ON UPDATE Cascade +) +; + +CREATE TABLE 'GrassCoverErosionOutwardsWaveConditionsOutputEntity' +( + 'GrassCoverErosionOutwardsWaveConditionsOutputEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'GrassCoverErosionOutwardsWaveConditionsCalculationEntityId' INTEGER NOT NULL, + 'Order' INT (4) NOT NULL, + 'OutputType' TINYINT (1) NOT NULL, -- Enum: 1 = WaveRunUp 2 = WaveImpact 3 = TailorMadeWaveImpact + 'WaterLevel' REAL NULL, + 'WaveHeight' REAL NULL, + 'WavePeakPeriod' REAL NULL, + 'WaveAngle' REAL NULL, + 'WaveDirection' REAL NULL, + 'TargetProbability' REAL NULL, + 'TargetReliability' REAL NULL, + 'CalculatedProbability' REAL NULL, + 'CalculatedReliability' REAL NULL, + 'CalculationConvergence' TINYINT (1) NOT NULL, -- Enum: 1 = NotCalculated, 2 = CalculationNotConverged, 3 = CalculationConverged + CONSTRAINT 'FK_GrassCoverErosionOutwardsWaveConditionsOutputEntity_GrassCoverErosionOutwardsWaveConditionsCalculationEntity' FOREIGN KEY ('GrassCoverErosionOutwardsWaveConditionsCalculationEntityId') REFERENCES 'GrassCoverErosionOutwardsWaveConditionsCalculationEntity' ('GrassCoverErosionOutwardsWaveConditionsCalculationEntityId') ON DELETE Cascade ON UPDATE Cascade +) +; + +CREATE TABLE 'GrassCoverSlipOffInwardsSectionResultEntity' +( + 'GrassCoverSlipOffInwardsSectionResultEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'FailureMechanismSectionEntityId' INTEGER NOT NULL, + 'SimpleAssessmentResult' TINYINT (1) NOT NULL, -- Enum: 1 = NotAssessed, 2 = Sufficient, 3 = NoVerdict + 'DetailedAssessmentResult' TINYINT (1) NOT NULL, -- Enum: 1 = None, 2 = Sufficient, 3 = Insufficient, 4 = NotAssessed + 'TailorMadeAssessmentResult' TINYINT (1) NOT NULL, -- Enum: 1 = None, 2 = ProbabilityNegligible, 3 = Sufficient, 4 = Insufficient, 5 = NotAssessed + 'UseManualAssembly' TINYINT (1) NOT NULL, -- true or false + 'ManualAssemblyCategoryGroup' TINYINT (1) NOT NULL, -- Enum: 1 = None, 2 = NotApplicable, 3 = Iv, 4 = IIv, 5 = Vv, 6 = VIIv + CONSTRAINT 'FK_GrassCoverSlipOffInwardsSectionResultEntity_FailureMechanismSectionEntity' FOREIGN KEY ('FailureMechanismSectionEntityId') REFERENCES 'FailureMechanismSectionEntity' ('FailureMechanismSectionEntityId') ON DELETE Cascade ON UPDATE Cascade +) +; + +CREATE TABLE 'GrassCoverSlipOffOutwardsSectionResultEntity' +( + 'GrassCoverSlipOffOutwardsSectionResultEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'FailureMechanismSectionEntityId' INTEGER NOT NULL, + 'SimpleAssessmentResult' TINYINT (1) NOT NULL, -- Enum: 1 = NotAssessed, 2 = Sufficient, 3 = NoVerdict + 'DetailedAssessmentResult' TINYINT (1) NOT NULL, -- Enum: 1 = None, 2 = Sufficient, 3 = Insufficient, 4 = NotAssessed + 'TailorMadeAssessmentResult' TINYINT (1) NOT NULL, -- Enum: 1 = None, 2 = ProbabilityNegligible, 3 = Sufficient, 4 = Insufficient, 5 = NotAssessed + 'UseManualAssembly' TINYINT (1) NOT NULL, -- true or false + 'ManualAssemblyCategoryGroup' TINYINT (1) NOT NULL, -- Enum: 1 = None, 2 = NotApplicable, 3 = Iv, 4 = IIv, 5 = Vv, 6 = VIIv + CONSTRAINT 'FK_GrassCoverSlipOffOutwardsSectionResultEntity_FailureMechanismSectionEntity' FOREIGN KEY ('FailureMechanismSectionEntityId') REFERENCES 'FailureMechanismSectionEntity' ('FailureMechanismSectionEntityId') ON DELETE Cascade ON UPDATE Cascade +) +; + +CREATE TABLE 'HeightStructureEntity' +( + 'HeightStructureEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'FailureMechanismEntityId' INTEGER NOT NULL, + 'Order' INT (4) NOT NULL, + 'Name' VARCHAR (260) NOT NULL, + 'Id' VARCHAR (260) NOT NULL, + 'X' REAL NULL, + 'Y' REAL NULL, + 'StructureNormalOrientation' REAL NULL, + 'LevelCrestStructureMean' REAL NULL, + 'LevelCrestStructureStandardDeviation' REAL NULL, + 'FlowWidthAtBottomProtectionMean' REAL NULL, + 'FlowWidthAtBottomProtectionStandardDeviation' REAL NULL, + 'CriticalOvertoppingDischargeMean' REAL NULL, + 'CriticalOvertoppingDischargeCoefficientOfVariation' REAL NULL, + 'WidthFlowAperturesMean' REAL NULL, + 'WidthFlowAperturesStandardDeviation' REAL NULL, + 'FailureProbabilityStructureWithErosion' REAL NULL, + 'StorageStructureAreaMean' REAL NULL, + 'StorageStructureAreaCoefficientOfVariation' REAL NULL, + 'AllowedLevelIncreaseStorageMean' REAL NULL, + 'AllowedLevelIncreaseStorageStandardDeviation' REAL NULL, + CONSTRAINT 'FK_HeightStructure_FailureMechanismEntity' FOREIGN KEY ('FailureMechanismEntityId') REFERENCES 'FailureMechanismEntity' ('FailureMechanismEntityId') ON DELETE Cascade ON UPDATE Cascade, + CONSTRAINT 'U_Id_FailureMechanismEntityId' UNIQUE ('FailureMechanismEntityId','Id') +) +; + +CREATE TABLE 'HeightStructuresCalculationEntity' +( + 'HeightStructuresCalculationEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'CalculationGroupEntityId' INTEGER NOT NULL, + 'HydraulicLocationEntityId' INTEGER NULL, + 'HeightStructureEntityId' INTEGER NULL, + 'ForeshoreProfileEntityId' INTEGER NULL, + 'Order' INT (4) NOT NULL, + 'Name' VARCHAR (260) NULL, + 'Comments' TEXT NULL, + 'ModelFactorSuperCriticalFlowMean' REAL NULL, + 'StructureNormalOrientation' REAL NULL, + 'AllowedLevelIncreaseStorageMean' REAL NULL, + 'AllowedLevelIncreaseStorageStandardDeviation' REAL NULL, + 'StorageStructureAreaMean' REAL NULL, + 'StorageStructureAreaCoefficientOfVariation' REAL NULL, + 'FlowWidthAtBottomProtectionMean' REAL NULL, + 'FlowWidthAtBottomProtectionStandardDeviation' REAL NULL, + 'CriticalOvertoppingDischargeMean' REAL NULL, + 'CriticalOvertoppingDischargeCoefficientOfVariation' REAL NULL, + 'FailureProbabilityStructureWithErosion' REAL NOT NULL, + 'WidthFlowAperturesMean' REAL NULL, + 'WidthFlowAperturesStandardDeviation' REAL NULL, + 'StormDurationMean' REAL NULL, + 'LevelCrestStructureMean' REAL NULL, + 'LevelCrestStructureStandardDeviation' REAL NULL, + 'DeviationWaveDirection' REAL NULL, + 'UseBreakWater' TINYINT (1) NOT NULL, -- true or false + 'UseForeshore' TINYINT (1) NOT NULL, -- true or false + 'BreakWaterType' TINYINT (1) NOT NULL, -- Enum: 1 = Wall, 2 = Caisson, 3 = Dam + 'BreakWaterHeight' REAL NULL, + 'ShouldIllustrationPointsBeCalculated' TINYINT (1) NOT NULL, -- true or false + 'RelevantForScenario' TINYINT (1) NOT NULL, -- true or false + 'ScenarioContribution' REAL NOT NULL, + CONSTRAINT 'FK_HeightStructuresCalculationEntity_CalculationGroupEntity' FOREIGN KEY ('CalculationGroupEntityId') REFERENCES 'CalculationGroupEntity' ('CalculationGroupEntityId') ON DELETE Cascade ON UPDATE Cascade, + CONSTRAINT 'FK_HeightStructuresCalculationEntity_ForeshoreProfileEntity' FOREIGN KEY ('ForeshoreProfileEntityId') REFERENCES 'ForeshoreProfileEntity' ('ForeshoreProfileEntityId') ON DELETE Set Null ON UPDATE Cascade, + CONSTRAINT 'FK_HeightStructuresCalculationEntity_HeightStructureEntity' FOREIGN KEY ('HeightStructureEntityId') REFERENCES 'HeightStructureEntity' ('HeightStructureEntityId') ON DELETE Set Null ON UPDATE Cascade, + CONSTRAINT 'FK_HeightStructuresCalculationEntity_HydraulicLocationEntity' FOREIGN KEY ('HydraulicLocationEntityId') REFERENCES 'HydraulicLocationEntity' ('HydraulicLocationEntityId') ON DELETE Set Null ON UPDATE Cascade +) +; + +CREATE TABLE 'HeightStructuresFailureMechanismMetaEntity' +( + 'HeightStructuresFailureMechanismMetaEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'FailureMechanismEntityId' INTEGER NOT NULL, + 'N' REAL NOT NULL, + 'HeightStructureCollectionSourcePath' TEXT NULL, + 'ForeshoreProfileCollectionSourcePath' TEXT NULL, + CONSTRAINT 'FK_HeightStructuresFailureMechanismMetaEntity_FailureMechanismEntity' FOREIGN KEY ('FailureMechanismEntityId') REFERENCES 'FailureMechanismEntity' ('FailureMechanismEntityId') ON DELETE Cascade ON UPDATE Cascade +) +; + +CREATE TABLE 'HeightStructuresOutputEntity' +( + 'HeightStructuresOutputEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'HeightStructuresCalculationEntityId' INTEGER NOT NULL, + 'GeneralResultFaultTreeIllustrationPointEntityId' INTEGER NULL, + 'Reliability' REAL NULL, + CONSTRAINT 'FK_HeightStructuresOutputEntity_GeneralResultFaultTreeIllustrationPointEntity' FOREIGN KEY ('GeneralResultFaultTreeIllustrationPointEntityId') REFERENCES 'GeneralResultFaultTreeIllustrationPointEntity' ('GeneralResultFaultTreeIllustrationPointEntityId') ON DELETE Set Null ON UPDATE Cascade, + CONSTRAINT 'FK_HeightStructuresOutputEntity_HeightStructuresCalculationEntity' FOREIGN KEY ('HeightStructuresCalculationEntityId') REFERENCES 'HeightStructuresCalculationEntity' ('HeightStructuresCalculationEntityId') ON DELETE Cascade ON UPDATE Cascade, + CONSTRAINT 'U_HeightStructuresCalculationEntity' UNIQUE ('HeightStructuresCalculationEntityId') +) +; + +CREATE TABLE 'HeightStructuresSectionResultEntity' +( + 'HeightStructuresSectionResultEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'FailureMechanismSectionEntityId' INTEGER NOT NULL, + 'SimpleAssessmentResult' TINYINT (1) NOT NULL, -- Enum: 1 = None, 2 = NotApplicable, 3 = ProbabilityNegligible 4 = AssessFurther + 'DetailedAssessmentResult' TINYINT (1) NOT NULL, -- Enum: 1 = Probability 2 = NotAssessed + 'TailorMadeAssessmentResult' TINYINT (1) NOT NULL, -- Enum: 1 = None 2 = ProbabilityNegligible 3 = Probability 4 = NotAssessed + 'TailorMadeAssessmentProbability' REAL NULL, + 'UseManualAssembly' TINYINT (1) NOT NULL, -- true or false + 'ManualAssemblyProbability' REAL NULL, + CONSTRAINT 'FK_HeightStructuresSectionResultEntity_FailureMechanismSectionEntity' FOREIGN KEY ('FailureMechanismSectionEntityId') REFERENCES 'FailureMechanismSectionEntity' ('FailureMechanismSectionEntityId') ON DELETE Cascade ON UPDATE Cascade +) +; + +CREATE TABLE 'HydraulicBoundaryDatabaseEntity' +( + 'HydraulicBoundaryDatabaseEntity' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'AssessmentSectionEntityId' INTEGER NOT NULL, + 'Version' TEXT NOT NULL, + 'FilePath' TEXT NOT NULL, + 'HydraulicLocationConfigurationSettingsFilePath' TEXT NOT NULL, + 'HydraulicLocationConfigurationSettingsScenarioName' TEXT NOT NULL, + 'HydraulicLocationConfigurationSettingsYear' INT (4) NOT NULL, + 'HydraulicLocationConfigurationSettingsScope' TEXT NOT NULL, + 'HydraulicLocationConfigurationSettingsUsePreprocessorClosure' TINYINT (1) NOT NULL, + 'HydraulicLocationConfigurationSettingsSeaLevel' TEXT NULL, + 'HydraulicLocationConfigurationSettingsRiverDischarge' TEXT NULL, + 'HydraulicLocationConfigurationSettingsLakeLevel' TEXT NULL, + 'HydraulicLocationConfigurationSettingsWindDirection' TEXT NULL, + 'HydraulicLocationConfigurationSettingsWindSpeed' TEXT NULL, + 'HydraulicLocationConfigurationSettingsComment' TEXT NULL, + CONSTRAINT 'FK_HydraulicBoundaryDatabaseEntity_AssessmentSectionEntity' FOREIGN KEY ('AssessmentSectionEntityId') REFERENCES 'AssessmentSectionEntity' ('AssessmentSectionEntityId') ON DELETE Cascade ON UPDATE Cascade +) +; + +CREATE TABLE 'HydraulicLocationCalculationCollectionEntity' +( + 'HydraulicLocationCalculationCollectionEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT +) +; + +CREATE TABLE 'HydraulicLocationCalculationEntity' +( + 'HydraulicLocationCalculationEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'HydraulicLocationEntityId' INTEGER NOT NULL, + 'HydraulicLocationCalculationCollectionEntityId' INTEGER NOT NULL, + 'ShouldIllustrationPointsBeCalculated' TINYINT (1) NOT NULL, -- True or false + CONSTRAINT 'FK_HydraulicLocationCalculationEntity_HydraulicLocationCalculationCollectionEntity' FOREIGN KEY ('HydraulicLocationCalculationCollectionEntityId') REFERENCES 'HydraulicLocationCalculationCollectionEntity' ('HydraulicLocationCalculationCollectionEntityId') ON DELETE Cascade ON UPDATE Cascade, + CONSTRAINT 'FK_HydraulicLocationCalculationEntity_HydraulicLocationEntity' FOREIGN KEY ('HydraulicLocationEntityId') REFERENCES 'HydraulicLocationEntity' ('HydraulicLocationEntityId') ON DELETE Cascade ON UPDATE Cascade +) +; + +CREATE TABLE 'HydraulicLocationOutputEntity' +( + 'HydraulicLocationOutputEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'HydraulicLocationCalculationEntityId' INTEGER NULL, + 'GeneralResultSubMechanismIllustrationPointEntityId' INTEGER NULL, + 'Result' REAL NULL, + 'TargetProbability' REAL NULL, + 'TargetReliability' REAL NULL, + 'CalculatedProbability' REAL NULL, + 'CalculatedReliability' REAL NULL, + '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_HydraulicLocationCalculationEntity' FOREIGN KEY ('HydraulicLocationCalculationEntityId') REFERENCES 'HydraulicLocationCalculationEntity' ('HydraulicLocationCalculationEntityId') ON DELETE Set Null ON UPDATE Cascade +) +; + +CREATE TABLE 'IllustrationPointResultEntity' +( + 'IllustrationPointResultEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'SubMechanismIllustrationPointEntityId' INTEGER NOT NULL, + 'Description' TEXT NOT NULL, + 'Unit' TEXT NOT NULL, + 'Value' REAL NOT NULL, + 'Order' INT (4) NOT NULL, + CONSTRAINT 'FK_IllustrationPointResultEntity_SubMechanismIllustrationPointEntity' FOREIGN KEY ('SubMechanismIllustrationPointEntityId') REFERENCES 'SubMechanismIllustrationPointEntity' ('SubMechanismIllustrationPointEntityId') ON DELETE Cascade ON UPDATE Cascade +) +; + +CREATE TABLE 'MacroStabilityInwardsCalculationEntity' +( + 'MacroStabilityInwardsCalculationEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'CalculationGroupEntityId' INTEGER NOT NULL, + 'SurfaceLineEntityId' INTEGER NULL, + 'MacroStabilityInwardsStochasticSoilProfileEntityId' INTEGER NULL, + 'HydraulicLocationEntityId' INTEGER NULL, + 'Order' INT (4) NOT NULL, + 'Name' VARCHAR (260) NULL, + 'Comment' TEXT NULL, + 'RelevantForScenario' TINYINT (1) NOT NULL, -- true or false + 'ScenarioContribution' REAL NOT NULL, + 'AssessmentLevel' REAL NULL, + 'UseAssessmentLevelManualInput' TINYINT (1) NOT NULL, -- true or false + 'SlipPlaneMinimumDepth' REAL NULL, + 'SlipPlaneMinimumLength' REAL NULL, + 'MaximumSliceWidth' REAL NULL, + 'MoveGrid' TINYINT (1) NOT NULL, -- true or false + 'GridDeterminationType' TINYINT (1) NOT NULL, -- Enumtype: 1 = Automatic, 2 = Manual + 'TangentLineDeterminationType' TINYINT (1) NOT NULL, -- Enumtype: 1 = Specified, 2 = LayerSeparated + 'TangentLineZTop' REAL NULL, + 'TangentLineZBottom' REAL NULL, + 'TangentLineNumber' INT (4) NOT NULL, + 'LeftGridXLeft' REAL NULL, + 'LeftGridXRight' REAL NULL, + 'LeftGridNrOfHorizontalPoints' INT (4) NOT NULL, + 'LeftGridZTop' REAL NULL, + 'LeftGridZBottom' REAL NULL, + 'LeftGridNrOfVerticalPoints' INT (4) NOT NULL, + 'RightGridXLeft' REAL NULL, + 'RightGridXRight' REAL NULL, + 'RightGridNrOfHorizontalPoints' INT (4) NOT NULL, + 'RightGridZTop' REAL NULL, + 'RightGridZBottom' REAL NULL, + 'RightGridNrOfVerticalPoints' INT (4) NOT NULL, + 'DikeSoilScenario' TINYINT (1) NOT NULL, -- Enumtype: 1 = ClayDikeOnClay, 2 = SandDikeOnClay, 3 = ClayDikeOnSand, 4 = SandDikeOnSand + 'WaterLevelRiverAverage' REAL NULL, + 'DrainageConstructionPresent' TINYINT (1) NOT NULL, -- true or false + 'DrainageConstructionCoordinateX' REAL NULL, + 'DrainageConstructionCoordinateZ' REAL NULL, + 'MinimumLevelPhreaticLineAtDikeTopRiver' REAL NULL, + 'MinimumLevelPhreaticLineAtDikeTopPolder' REAL NULL, + 'AdjustPhreaticLine3And4ForUplift' TINYINT (1) NOT NULL, -- true or false + 'LeakageLengthOutwardsPhreaticLine3' REAL NULL, + 'LeakageLengthInwardsPhreaticLine3' REAL NULL, + 'LeakageLengthOutwardsPhreaticLine4' REAL NULL, + 'LeakageLengthInwardsPhreaticLine4' REAL NULL, + 'PiezometricHeadPhreaticLine2Outwards' REAL NULL, + 'PiezometricHeadPhreaticLine2Inwards' REAL NULL, + 'LocationInputExtremeWaterLevelPolder' REAL NULL, + 'LocationInputExtremeUseDefaultOffsets' TINYINT (1) NOT NULL, -- true or false + 'LocationInputExtremePhreaticLineOffsetBelowDikeTopAtRiver' REAL NULL, + 'LocationInputExtremePhreaticLineOffsetBelowDikeTopAtPolder' REAL NULL, + 'LocationInputExtremePhreaticLineOffsetBelowShoulderBaseInside' REAL NULL, + 'LocationInputExtremePhreaticLineOffsetDikeToeAtPolder' REAL NULL, + 'LocationInputExtremePenetrationLength' REAL NULL, + 'LocationInputDailyWaterLevelPolder' REAL NULL, + 'LocationInputDailyUseDefaultOffsets' TINYINT (1) NOT NULL, -- true or false + 'LocationInputDailyPhreaticLineOffsetBelowDikeTopAtRiver' REAL NULL, + 'LocationInputDailyPhreaticLineOffsetBelowDikeTopAtPolder' REAL NULL, + 'LocationInputDailyPhreaticLineOffsetBelowShoulderBaseInside' REAL NULL, + 'LocationInputDailyPhreaticLineOffsetDikeToeAtPolder' REAL NULL, + 'CreateZones' TINYINT (1) NOT NULL, -- true or false + 'ZoningBoundariesDeterminationType' TINYINT (1) NOT NULL, -- Enumtype: 1 = Automatic 2 = Manual + 'ZoneBoundaryLeft' REAL NULL, + 'ZoneBoundaryRight' REAL NULL, + CONSTRAINT 'FK_MacroStabilityInwardsCalculationEntity_CalculationGroupEntity' FOREIGN KEY ('CalculationGroupEntityId') REFERENCES 'CalculationGroupEntity' ('CalculationGroupEntityId') ON DELETE Cascade ON UPDATE Cascade, + CONSTRAINT 'FK_MacroStabilityInwardsCalculationEntity_HydraulicLocationEntity' FOREIGN KEY ('HydraulicLocationEntityId') REFERENCES 'HydraulicLocationEntity' ('HydraulicLocationEntityId') ON DELETE Set Null ON UPDATE Cascade, + CONSTRAINT 'FK_MacroStabilityInwardsCalculationEntity_MacroStabilityInwardsStochasticSoilProfileEntity' FOREIGN KEY ('MacroStabilityInwardsStochasticSoilProfileEntityId') REFERENCES 'MacroStabilityInwardsStochasticSoilProfileEntity' ('MacroStabilityInwardsStochasticSoilProfileEntityId') ON DELETE Set Null ON UPDATE Cascade, + CONSTRAINT 'FK_MacroStabilityInwardsCalculationEntity_SurfaceLineEntity' FOREIGN KEY ('SurfaceLineEntityId') REFERENCES 'SurfaceLineEntity' ('SurfaceLineEntityId') ON DELETE Set Null ON UPDATE Cascade +) +; + +CREATE TABLE 'MacroStabilityInwardsCalculationOutputEntity' +( + 'MacroStabilityInwardsCalculationOutputEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'MacroStabilityInwardsCalculationEntityId' INTEGER NOT NULL, + 'FactorOfStability' REAL NULL, + 'ForbiddenZonesXEntryMin' REAL NULL, + 'ForbiddenZonesXEntryMax' REAL NULL, + 'SlidingCurveLeftSlidingCircleCenterX' REAL NULL, + 'SlidingCurveLeftSlidingCircleCenterY' REAL NULL, + 'SlidingCurveLeftSlidingCircleRadius' REAL NULL, + 'SlidingCurveLeftSlidingCircleIsActive' TINYINT (1) NOT NULL, -- true or false + 'SlidingCurveLeftSlidingCircleNonIteratedForce' REAL NULL, + 'SlidingCurveLeftSlidingCircleIteratedForce' REAL NULL, + 'SlidingCurveLeftSlidingCircleDrivingMoment' REAL NULL, + 'SlidingCurveLeftSlidingCircleResistingMoment' REAL NULL, + 'SlidingCurveRightSlidingCircleCenterX' REAL NULL, + 'SlidingCurveRightSlidingCircleCenterY' REAL NULL, + 'SlidingCurveRightSlidingCircleRadius' REAL NULL, + 'SlidingCurveRightSlidingCircleIsActive' TINYINT (1) NOT NULL, -- true or false + 'SlidingCurveRightSlidingCircleNonIteratedForce' REAL NULL, + 'SlidingCurveRightSlidingCircleIteratedForce' REAL NULL, + 'SlidingCurveRightSlidingCircleDrivingMoment' REAL NULL, + 'SlidingCurveRightSlidingCircleResistingMoment' REAL NULL, + 'SlidingCurveNonIteratedHorizontalForce' REAL NULL, + 'SlidingCurveIteratedHorizontalForce' REAL NULL, + 'SlidingCurveSliceXML' TEXT NOT NULL, -- XML representation of MacroStabilityInwardsSlice + 'SlipPlaneLeftGridXLeft' REAL NULL, + 'SlipPlaneLeftGridXRight' REAL NULL, + 'SlipPlaneLeftGridNrOfHorizontalPoints' INT (4) NOT NULL, + 'SlipPlaneLeftGridZTop' REAL NULL, + 'SlipPlaneLeftGridZBottom' REAL NULL, + 'SlipPlaneLeftGridNrOfVerticalPoints' INT (4) NOT NULL, + 'SlipPlaneRightGridXLeft' REAL NULL, + 'SlipPlaneRightGridXRight' REAL NULL, + 'SlipPlaneRightGridNrOfHorizontalPoints' INT (4) NOT NULL, + 'SlipPlaneRightGridZTop' REAL NULL, + 'SlipPlaneRightGridZBottom' REAL NULL, + 'SlipPlaneRightGridNrOfVerticalPoints' INT (4) NOT NULL, + 'SlipPlaneTangentLinesXml' TEXT NOT NULL, -- XML representation of TangentLines + CONSTRAINT 'FK_MacroStabilityInwardsCalculationOutput_MacroStabilityInwardsCalculationEntity' FOREIGN KEY ('MacroStabilityInwardsCalculationEntityId') REFERENCES 'MacroStabilityInwardsCalculationEntity' ('MacroStabilityInwardsCalculationEntityId') ON DELETE Cascade ON UPDATE Cascade +) +; + +CREATE TABLE 'MacroStabilityInwardsCharacteristicPointEntity' +( + 'MacroStabilityInwardsCharacteristicPointEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'SurfaceLineEntityId' INTEGER NOT NULL, + 'Type' SMALLINT NOT NULL, -- Enumtype: 1 = SurfaceLevelOutside 2 = DikeTopAtRiver 3 = DikeToeAtRiver 4 = DikeTopAtPolder 5 = ShoulderBaseInside 6 = ShoulderTopInside 7 = DikeToeAtPolder 8 = DitchDikeSide 9 = BottomDitchDikeSide 10 = BottomDitchPolderSide 11 = DitchPolderSide 12 = SurfaceLevelInside + 'X' REAL NULL, + 'Y' REAL NULL, + 'Z' REAL NULL, + CONSTRAINT 'FK_MacroStabilityInwardsCharacteristicPointEntity_SurfaceLineEntity' FOREIGN KEY ('SurfaceLineEntityId') REFERENCES 'SurfaceLineEntity' ('SurfaceLineEntityId') ON DELETE Cascade ON UPDATE Cascade +) +; + +CREATE TABLE 'MacroStabilityInwardsFailureMechanismMetaEntity' +( + 'MacroStabilityInwardsFailureMechanismMetaEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'FailureMechanismEntityId' INTEGER NOT NULL, + 'A' REAL NOT NULL, + 'StochasticSoilModelCollectionSourcePath' TEXT NULL, + 'SurfaceLineCollectionSourcePath' TEXT NULL, + CONSTRAINT 'FK_MacroStabilityInwardsFailureMechanismMetaEntity_FailureMechanismEntity' FOREIGN KEY ('FailureMechanismEntityId') REFERENCES 'FailureMechanismEntity' ('FailureMechanismEntityId') ON DELETE Cascade ON UPDATE Cascade +) +; + +CREATE TABLE 'MacroStabilityInwardsPreconsolidationStressEntity' +( + 'MacroStabilityInwardsPreconsolidationStressEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'MacroStabilityInwardsSoilProfileTwoDEntityId' INTEGER NOT NULL, + 'CoordinateX' REAL NOT NULL, + 'CoordinateZ' REAL NOT NULL, + 'PreconsolidationStressMean' REAL NULL, + 'PreconsolidationStressCoefficientOfVariation' REAL NULL, + 'Order' INT (4) NOT NULL, + CONSTRAINT 'FK_MacroStabilityInwardsPreconsolidationStressEntity_MacroStabilityInwardsSoilProfileTwoDEntity' FOREIGN KEY ('MacroStabilityInwardsSoilProfileTwoDEntityId') REFERENCES 'MacroStabilityInwardsSoilProfileTwoDEntity' ('MacroStabilityInwardsSoilProfileTwoDEntityId') ON DELETE Cascade ON UPDATE Cascade +) +; + +CREATE TABLE 'MacroStabilityInwardsSectionResultEntity' +( + 'MacroStabilityInwardsSectionResultEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'FailureMechanismSectionEntityId' INTEGER NOT NULL, + 'SimpleAssessmentResult' TINYINT (1) NOT NULL, -- Enum: 1 = None, 2 = NotApplicable, 3 = ProbabilityNegligible, 4 = AssessFurther + 'DetailedAssessmentResult' TINYINT (1) NOT NULL, -- Enum: 1 = Probability, 2 = NotAssessed + 'TailorMadeAssessmentResult' TINYINT (1) NOT NULL, -- Enum: 1 = None, 2 = ProbabilityNegligible, 3 = Probability, 4 = NotAssessed + 'TailorMadeAssessmentProbability' REAL NULL, + 'UseManualAssembly' TINYINT (1) NOT NULL, -- true or false + 'ManualAssemblyProbability' REAL NULL, + CONSTRAINT 'FK_MacroStabilityInwardsSectionResultEntity_FailureMechanismSectionEntity' FOREIGN KEY ('FailureMechanismSectionEntityId') REFERENCES 'FailureMechanismSectionEntity' ('FailureMechanismSectionEntityId') ON DELETE Cascade ON UPDATE Cascade +) +; + +CREATE TABLE 'MacroStabilityInwardsSoilLayerOneDEntity' +( + 'MacroStabilityInwardsSoilLayerOneDEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'MacroStabilityInwardsSoilProfileOneDEntityId' INTEGER NOT NULL, + 'Top' REAL NULL, + 'IsAquifer' TINYINT (1) NOT NULL, -- true or false + 'Color' INTEGER NULL, -- ARGB value of Color. + 'MaterialName' TEXT NOT NULL, + 'ShearStrengthModel' TINYINT (1) NOT NULL, -- Enumtype: 1 = SuCalculated, 2 = CPhi, 3 = CPhiOrSuCalculated + 'UsePop' TINYINT (1) NOT NULL, -- true of false + 'AbovePhreaticLevelMean' REAL NULL, + 'AbovePhreaticLevelCoefficientOfVariation' REAL NULL, + 'AbovePhreaticLevelShift' REAL NULL, + 'BelowPhreaticLevelMean' REAL NULL, + 'BelowPhreaticLevelCoefficientOfVariation' REAL NULL, + 'BelowPhreaticLevelShift' REAL NULL, + 'CohesionMean' REAL NULL, + 'CohesionCoefficientOfVariation' REAL NULL, + 'FrictionAngleMean' REAL NULL, + 'FrictionAngleCoefficientOfVariation' REAL NULL, + 'ShearStrengthRatioMean' REAL NULL, + 'ShearStrengthRatioCoefficientOfVariation' REAL NULL, + 'StrengthIncreaseExponentMean' REAL NULL, + 'StrengthIncreaseExponentCoefficientOfVariation' REAL NULL, + 'PopMean' REAL NULL, + 'PopCoefficientOfVariation' REAL NULL, + 'Order' INT (4) NOT NULL, + CONSTRAINT 'FK_MacroStabilityInwardsSoilLayerOneDEntity_MacroStabilityInwardsSoilProfileOneDEntity' FOREIGN KEY ('MacroStabilityInwardsSoilProfileOneDEntityId') REFERENCES 'MacroStabilityInwardsSoilProfileOneDEntity' ('MacroStabilityInwardsSoilProfileOneDEntityId') ON DELETE Cascade ON UPDATE Cascade +) +; + +CREATE TABLE 'MacroStabilityInwardsSoilLayerTwoDEntity' +( + 'MacroStabilityInwardsSoilLayerTwoDEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'ParentMacroStabilityInwardsSoilLayerTwoDEntityId' INTEGER NULL, + 'IsAquifer' TINYINT (1) NOT NULL, -- true or false + 'Color' INTEGER NULL, -- ARGB value of Color. + 'MaterialName' TEXT NOT NULL, + 'ShearStrengthModel' TINYINT (1) NOT NULL, -- Enumtype: 1 = SuCalculated, 2 = CPhi, 3 = CPhiOrSuCalculated + 'UsePop' TINYINT (1) NOT NULL, -- true of false + 'AbovePhreaticLevelMean' REAL NULL, + 'AbovePhreaticLevelCoefficientOfVariation' REAL NULL, + 'AbovePhreaticLevelShift' REAL NULL, + 'BelowPhreaticLevelMean' REAL NULL, + 'BelowPhreaticLevelCoefficientOfVariation' REAL NULL, + 'BelowPhreaticLevelShift' REAL NULL, + 'CohesionMean' REAL NULL, + 'CohesionCoefficientOfVariation' REAL NULL, + 'FrictionAngleMean' REAL NULL, + 'FrictionAngleCoefficientOfVariation' REAL NULL, + 'ShearStrengthRatioMean' REAL NULL, + 'ShearStrengthRatioCoefficientOfVariation' REAL NULL, + 'StrengthIncreaseExponentMean' REAL NULL, + 'StrengthIncreaseExponentCoefficientOfVariation' REAL NULL, + 'PopMean' REAL NULL, + 'PopCoefficientOfVariation' REAL NULL, + 'OuterRingXml' TEXT NOT NULL, + 'Order' INT (4) NOT NULL, + CONSTRAINT 'FK_MacroStabilityInwardsSoilLayerTwoDEntity_MacroStabilityInwardsSoilLayerTwoDEntity' FOREIGN KEY ('ParentMacroStabilityInwardsSoilLayerTwoDEntityId') REFERENCES 'MacroStabilityInwardsSoilLayerTwoDEntity' ('MacroStabilityInwardsSoilLayerTwoDEntityId') ON DELETE Cascade ON UPDATE Cascade +) +; + +CREATE TABLE 'MacroStabilityInwardsSoilProfileOneDEntity' +( + 'MacroStabilityInwardsSoilProfileOneDEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'Name' TEXT NOT NULL, + 'Bottom' REAL NULL +) +; + +CREATE TABLE 'MacroStabilityInwardsSoilProfileTwoDEntity' +( + 'MacroStabilityInwardsSoilProfileTwoDEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'Name' TEXT NOT NULL +) +; + +CREATE TABLE 'MacroStabilityInwardsSoilProfileTwoDSoilLayerTwoDEntity' +( + 'MacroStabilityInwardsSoilProfileTwoDEntityId' INTEGER NOT NULL, + 'MacroStabilityInwardsSoilLayerTwoDEntityId' INTEGER NOT NULL, + CONSTRAINT 'PK_MacroStabilityInwardsSoilProfileTwoDSoilLayerTwoDEntity' PRIMARY KEY ('MacroStabilityInwardsSoilProfileTwoDEntityId','MacroStabilityInwardsSoilLayerTwoDEntityId'), + CONSTRAINT 'FK_MacroStabilityInwardsSoilProfileTwoDSoilLayerTwoDEntity_MacroStabilityInwardsSoilLayerTwoDEntity' FOREIGN KEY ('MacroStabilityInwardsSoilLayerTwoDEntityId') REFERENCES 'MacroStabilityInwardsSoilLayerTwoDEntity' ('MacroStabilityInwardsSoilLayerTwoDEntityId') ON DELETE Cascade ON UPDATE Cascade, + CONSTRAINT 'FK_MacroStabilityInwardsSoilProfileTwoDSoilLayerTwoDEntity_MacroStabilityInwardsSoilProfileTwoDEntity' FOREIGN KEY ('MacroStabilityInwardsSoilProfileTwoDEntityId') REFERENCES 'MacroStabilityInwardsSoilProfileTwoDEntity' ('MacroStabilityInwardsSoilProfileTwoDEntityId') ON DELETE Cascade ON UPDATE Cascade +) +; + +CREATE TABLE 'MacroStabilityInwardsStochasticSoilProfileEntity' +( + 'MacroStabilityInwardsStochasticSoilProfileEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'StochasticSoilModelEntityId' INTEGER NOT NULL, + 'MacroStabilityInwardsSoilProfileOneDEntityId' INTEGER NULL, + 'MacroStabilityInwardsSoilProfileTwoDEntityId' INTEGER NULL, + 'Probability' REAL NOT NULL, + 'Order' INT (4) NOT NULL, + CONSTRAINT 'FK_MacroStabilityInwardsStochasticSoilProfileEntity_MacroStabilityInwardsSoilProfileOneDEntity' FOREIGN KEY ('MacroStabilityInwardsSoilProfileOneDEntityId') REFERENCES 'MacroStabilityInwardsSoilProfileOneDEntity' ('MacroStabilityInwardsSoilProfileOneDEntityId') ON DELETE Cascade ON UPDATE Cascade, + CONSTRAINT 'FK_MacroStabilityInwardsStochasticSoilProfileEntity_MacroStabilityInwardsSoilProfileTwoDEntity' FOREIGN KEY ('MacroStabilityInwardsSoilProfileTwoDEntityId') REFERENCES 'MacroStabilityInwardsSoilProfileTwoDEntity' ('MacroStabilityInwardsSoilProfileTwoDEntityId') ON DELETE Cascade ON UPDATE Cascade, + CONSTRAINT 'FK_MacroStabilityInwardsStochasticSoilProfileEntity_StochasticSoilModelEntity' FOREIGN KEY ('StochasticSoilModelEntityId') REFERENCES 'StochasticSoilModelEntity' ('StochasticSoilModelEntityId') ON DELETE Cascade ON UPDATE Cascade +) +; + +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 'MacroStabilityOutwardsSectionResultEntity' +( + 'MacroStabilityOutwardsSectionResultEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'FailureMechanismSectionEntityId' INTEGER NOT NULL, + 'SimpleAssessmentResult' TINYINT (1) NOT NULL, -- Enum: 1 = None, 2 = NotApplicable, 3 = ProbabilityNegligible, 4 = AssessFurther + 'DetailedAssessmentResult' TINYINT (1) NOT NULL, -- Enum: 1 = Probability, 2 = NotAssessed + 'DetailedAssessmentProbability' REAL NULL, + 'TailorMadeAssessmentResult' TINYINT (1) NOT NULL, -- Enum: 1 = None, 2 = ProbabilityNegligible, 3 = Probability, 4 = Sufficient, 5 = Insufficient, 6 = NotAssessed + 'TailorMadeAssessmentProbability' REAL NULL, + 'UseManualAssembly' TINYINT (1) NOT NULL, -- true or false + 'ManualAssemblyCategoryGroup' TINYINT (1) NOT NULL, -- Enum: 1 = None, 2 = NotApplicable, 3 = Iv, 4 = IIv, 5 = Vv, 6 = VIIv + CONSTRAINT 'FK_MacroStabilityOutwardsSectionResultEntity_FailureMechanismSectionEntity' FOREIGN KEY ('FailureMechanismSectionEntityId') REFERENCES 'FailureMechanismSectionEntity' ('FailureMechanismSectionEntityId') ON DELETE Cascade ON UPDATE Cascade +) +; + +CREATE TABLE 'MicrostabilitySectionResultEntity' +( + 'MicrostabilitySectionResultEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'FailureMechanismSectionEntityId' INTEGER NOT NULL, + 'SimpleAssessmentResult' TINYINT (1) NOT NULL, -- Enum: 1 = NotAssessed, 2 = Sufficient, 3 = NoVerdict + 'DetailedAssessmentResult' TINYINT (1) NOT NULL, -- Enum: 1 = None, 2 = Sufficient, 3 = Insufficient, 4 = NotAssessed + 'TailorMadeAssessmentResult' TINYINT (1) NOT NULL, -- Enum: 1 = None, 2 = ProbabilityNegligible, 3 = Sufficient, 4 = Insufficient, 5 = NotAssessed + 'UseManualAssembly' TINYINT (1) NOT NULL, -- true or false + 'ManualAssemblyCategoryGroup' TINYINT (1) NOT NULL, -- Enum: 1 = None, 2 = NotApplicable, 3 = Iv, 4 = IIv, 5 = Vv, 6 = VIIv + CONSTRAINT 'FK_MicrostabilitySectionResultEntity_FailureMechanismSectionEntity' FOREIGN KEY ('FailureMechanismSectionEntityId') REFERENCES 'FailureMechanismSectionEntity' ('FailureMechanismSectionEntityId') ON DELETE Cascade ON UPDATE Cascade +) +; + +CREATE TABLE 'PipingFailureMechanismMetaEntity' +( + 'PipingFailureMechanismMetaEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'FailureMechanismEntityId' INTEGER NOT NULL, + 'A' REAL NOT NULL, + 'WaterVolumetricWeight' REAL NOT NULL, + 'StochasticSoilModelCollectionSourcePath' TEXT NULL, + 'SurfaceLineCollectionSourcePath' TEXT NULL, + CONSTRAINT 'FK_PipingFailureMechanismMetaEntity_FailureMechanismEntity' FOREIGN KEY ('FailureMechanismEntityId') REFERENCES 'FailureMechanismEntity' ('FailureMechanismEntityId') ON DELETE Cascade ON UPDATE Cascade +) +; + +CREATE TABLE 'PipingSectionResultEntity' +( + 'PipingSectionResultEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'FailureMechanismSectionEntityId' INTEGER NOT NULL, + 'SimpleAssessmentResult' TINYINT (1) NOT NULL, -- Enum: 1 = None, 2 = NotApplicable, 3 = ProbabilityNegligible, 4 = AssessFurther + 'DetailedAssessmentResult' TINYINT (1) NOT NULL, -- Enum: 1 = Probability, 2 = NotAssessed + 'TailorMadeAssessmentResult' TINYINT (1) NOT NULL, -- Enum: 1 = None, 2 = ProbabilityNegligible, 3 = Probability, 4 = NotAssessed + 'TailorMadeAssessmentProbability' REAL NULL, + 'UseManualAssembly' TINYINT (1) NOT NULL, -- true or false + 'ManualAssemblyProbability' REAL NULL, + CONSTRAINT 'FK_PipingSectionResultEntity_FailureMechanismSectionEntity' FOREIGN KEY ('FailureMechanismSectionEntityId') REFERENCES 'FailureMechanismSectionEntity' ('FailureMechanismSectionEntityId') ON DELETE Cascade ON UPDATE Cascade +) +; + +CREATE TABLE 'PipingStructureFailureMechanismMetaEntity' +( + 'PipingStructureFailureMechanismMetaEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'FailureMechanismEntityId' INTEGER NOT NULL, + 'N' REAL NOT NULL, + CONSTRAINT 'FK_PipingStructureFailureMechanismMetaEntity_FailureMechanismEntity' FOREIGN KEY ('FailureMechanismEntityId') REFERENCES 'FailureMechanismEntity' ('FailureMechanismEntityId') ON DELETE Cascade ON UPDATE Cascade +) +; + +CREATE TABLE 'PipingStructureSectionResultEntity' +( + 'PipingStructureSectionResultEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'FailureMechanismSectionEntityId' INTEGER NOT NULL, + 'SimpleAssessmentResult' TINYINT (1) NOT NULL, -- Enum: 1 = NotAssessed, 2 = Sufficient, 3 = NoVerdict + 'DetailedAssessmentResult' TINYINT (1) NOT NULL, -- Enum: 1 = None, 2 = Sufficient, 3 = Insufficient, 4 = NotAssessed + 'TailorMadeAssessmentResult' TINYINT (1) NOT NULL, -- Enum: 1 = None, 2 = ProbabilityNegligible, 3 = Sufficient, 4 = Insufficient, 5 = NotAssessed + 'UseManualAssembly' TINYINT (1) NOT NULL, -- true or false + 'ManualAssemblyCategoryGroup' TINYINT (1) NOT NULL, -- Enum: 1 = None, 2 = NotApplicable, 3 = Iv, 4 = IIv, 5 = Vv, 6 = VIIv + CONSTRAINT 'FK_PipingStructureSectionResultEntity_FailureMechanismSectionEntity' FOREIGN KEY ('FailureMechanismSectionEntityId') REFERENCES 'FailureMechanismSectionEntity' ('FailureMechanismSectionEntityId') ON DELETE Cascade ON UPDATE Cascade +) +; + +CREATE TABLE 'ProbabilisticPipingCalculationEntity' +( + 'ProbabilisticPipingCalculationEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'CalculationGroupEntityId' INTEGER NOT NULL, + 'SurfaceLineEntityId' INTEGER NULL, + 'PipingStochasticSoilProfileEntityId' INTEGER NULL, + 'HydraulicLocationEntityId' INTEGER NULL, + 'Order' INT (4) NOT NULL, + 'Name' VARCHAR (260) NULL, + 'Comments' TEXT NULL, + 'EntryPointL' REAL NULL, + 'ExitPointL' REAL NULL, + 'PhreaticLevelExitMean' REAL NULL, + 'PhreaticLevelExitStandardDeviation' REAL NULL, + 'DampingFactorExitMean' REAL NULL, + 'DampingFactorExitStandardDeviation' REAL NULL, + 'RelevantForScenario' TINYINT (1) NOT NULL, -- true or false + 'ScenarioContribution' REAL NOT NULL, + 'ShouldProfileSpecificIllustrationPointsBeCalculated' TINYINT (1) NOT NULL, -- true or false + 'ShouldSectionSpecificIllustrationPointsBeCalculated' TINYINT (1) NOT NULL, -- true or false + CONSTRAINT 'FK_ProbabilisticPipingCalculationEntity_CalculationGroupEntity' FOREIGN KEY ('CalculationGroupEntityId') REFERENCES 'CalculationGroupEntity' ('CalculationGroupEntityId') ON DELETE Cascade ON UPDATE Cascade, + CONSTRAINT 'FK_ProbabilisticPipingCalculationEntity_HydraulicLocationEntity' FOREIGN KEY ('HydraulicLocationEntityId') REFERENCES 'HydraulicLocationEntity' ('HydraulicLocationEntityId') ON DELETE Set Null ON UPDATE Cascade, + CONSTRAINT 'FK_ProbabilisticPipingCalculationEntity_PipingStochasticSoilProfileEntity' FOREIGN KEY ('PipingStochasticSoilProfileEntityId') REFERENCES 'PipingStochasticSoilProfileEntity' ('PipingStochasticSoilProfileEntityId') ON DELETE Set Null ON UPDATE Cascade, + CONSTRAINT 'FK_ProbabilisticPipingCalculationEntity_SurfaceLineEntity' FOREIGN KEY ('SurfaceLineEntityId') REFERENCES 'SurfaceLineEntity' ('SurfaceLineEntityId') ON DELETE Set Null ON UPDATE Cascade +) +; + +CREATE TABLE 'ProbabilisticPipingCalculationOutputEntity' +( + 'ProbabilisticPipingCalculationOutputEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'ProbabilisticPipingCalculationEntityId' INTEGER NOT NULL, + 'ProfileSpecificGeneralResultFaultTreeIllustrationPointEntityId' INTEGER NULL, + 'SectionSpecificGeneralResultFaultTreeIllustrationPointEntityId' INTEGER NULL, + 'ProfileSpecificGeneralResultSubMechanismIllustrationPointEntityId' INTEGER NULL, + 'SectionSpecificGeneralResultSubMechanismIllustrationPointEntityId' INTEGER NULL, + 'Order' INT (4) NOT NULL, + 'ProfileSpecificReliability' REAL NULL, + 'SectionSpecificReliability' REAL NULL, + CONSTRAINT 'FK_ProbabilisticPipingCalculationOutputEntity_ProbabilisticPipingCalculationEntity' FOREIGN KEY ('ProbabilisticPipingCalculationEntityId') REFERENCES 'ProbabilisticPipingCalculationEntity' ('ProbabilisticPipingCalculationEntityId') ON DELETE Cascade ON UPDATE Cascade, + CONSTRAINT 'FK_ProbabilisticPipingCalculationOutputEntity_Profile_GeneralResultFaultTreeIllustrationPointEntity' FOREIGN KEY ('ProfileSpecificGeneralResultFaultTreeIllustrationPointEntityId') REFERENCES 'GeneralResultFaultTreeIllustrationPointEntity' ('GeneralResultFaultTreeIllustrationPointEntityId') ON DELETE Cascade ON UPDATE Cascade, + CONSTRAINT 'FK_ProbabilisticPipingCalculationOutputEntity_Profile_GeneralResultSubMechanismIllustrationPointEntity' FOREIGN KEY ('ProfileSpecificGeneralResultSubMechanismIllustrationPointEntityId') REFERENCES 'GeneralResultSubMechanismIllustrationPointEntity' ('GeneralResultSubMechanismIllustrationPointEntityId') ON DELETE Cascade ON UPDATE Cascade, + CONSTRAINT 'FK_ProbabilisticPipingCalculationOutputEntity_Section_GeneralResultFaultTreeIllustrationPointEntity' FOREIGN KEY ('SectionSpecificGeneralResultFaultTreeIllustrationPointEntityId') REFERENCES 'GeneralResultFaultTreeIllustrationPointEntity' ('GeneralResultFaultTreeIllustrationPointEntityId') ON DELETE Cascade ON UPDATE Cascade, + CONSTRAINT 'FK_ProbabilisticPipingCalculationOutputEntity_Section_GeneralResultSubMechanismIllustrationPointEntity' FOREIGN KEY ('SectionSpecificGeneralResultSubMechanismIllustrationPointEntityId') REFERENCES 'GeneralResultSubMechanismIllustrationPointEntity' ('GeneralResultSubMechanismIllustrationPointEntityId') ON DELETE No Action ON UPDATE No Action, + CONSTRAINT 'U_ProbabilisticPipingCalculationEntity' UNIQUE ('ProbabilisticPipingCalculationEntityId') +) +; + +CREATE TABLE 'SemiProbabilisticPipingCalculationOutputEntity' +( + 'SemiProbabilisticPipingCalculationOutputEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'SemiProbabilisticPipingCalculationEntityId' INTEGER NOT NULL, + 'Order' INT (4) NOT NULL, + 'HeaveFactorOfSafety' REAL NULL, + 'UpliftFactorOfSafety' REAL NULL, + 'SellmeijerFactorOfSafety' REAL NULL, + 'UpliftEffectiveStress' REAL NULL, + 'HeaveGradient' REAL NULL, + 'SellmeijerCreepCoefficient' REAL NULL, + 'SellmeijerCriticalFall' REAL NULL, + 'SellmeijerReducedFall' REAL NULL, + CONSTRAINT 'FK_SemiProbabilisticPipingCalculationOutputEntity_SemiProbabilisticPipingCalculationEntity' FOREIGN KEY ('SemiProbabilisticPipingCalculationEntityId') REFERENCES 'SemiProbabilisticPipingCalculationEntity' ('SemiProbabilisticPipingCalculationEntityId') ON DELETE Cascade ON UPDATE Cascade, + CONSTRAINT 'U_SemiProbabilisticPipingCalculationEntity' UNIQUE ('SemiProbabilisticPipingCalculationEntityId') +) +; + +CREATE TABLE 'StabilityPointStructureEntity' +( + 'StabilityPointStructureEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'FailureMechanismEntityId' INTEGER NOT NULL, + 'Order' INT (4) NOT NULL, + 'Name' VARCHAR (260) NOT NULL, + 'Id' VARCHAR (260) NOT NULL, + 'X' REAL NULL, + 'Y' REAL NULL, + 'StructureNormalOrientation' REAL NULL, + 'StorageStructureAreaMean' REAL NULL, + 'StorageStructureAreaCoefficientOfVariation' REAL NULL, + 'AllowedLevelIncreaseStorageMean' REAL NULL, + 'AllowedLevelIncreaseStorageStandardDeviation' REAL NULL, + 'WidthFlowAperturesMean' REAL NULL, + 'WidthFlowAperturesStandardDeviation' REAL NULL, + 'InsideWaterLevelMean' REAL NULL, + 'InsideWaterLevelStandardDeviation' REAL NULL, + 'ThresholdHeightOpenWeirMean' REAL NULL, + 'ThresholdHeightOpenWeirStandardDeviation' REAL NULL, + 'CriticalOvertoppingDischargeMean' REAL NULL, + 'CriticalOvertoppingDischargeCoefficientOfVariation' REAL NULL, + 'FlowWidthAtBottomProtectionMean' REAL NULL, + 'FlowWidthAtBottomProtectionStandardDeviation' REAL NULL, + 'ConstructiveStrengthLinearLoadModelMean' REAL NULL, + 'ConstructiveStrengthLinearLoadModelCoefficientOfVariation' REAL NULL, + 'ConstructiveStrengthQuadraticLoadModelMean' REAL NULL, + 'ConstructiveStrengthQuadraticLoadModelCoefficientOfVariation' REAL NULL, + 'BankWidthMean' REAL NULL, + 'BankWidthStandardDeviation' REAL NULL, + 'InsideWaterLevelFailureConstructionMean' REAL NULL, + 'InsideWaterLevelFailureConstructionStandardDeviation' REAL NULL, + 'EvaluationLevel' REAL NULL, + 'LevelCrestStructureMean' REAL NULL, + 'LevelCrestStructureStandardDeviation' REAL NULL, + 'VerticalDistance' REAL NULL, + 'FailureProbabilityRepairClosure' REAL NULL, + 'FailureCollisionEnergyMean' REAL NULL, + 'FailureCollisionEnergyCoefficientOfVariation' REAL NULL, + 'ShipMassMean' REAL NULL, + 'ShipMassCoefficientOfVariation' REAL NULL, + 'ShipVelocityMean' REAL NULL, + 'ShipVelocityCoefficientOfVariation' REAL NULL, + 'LevellingCount' INT (4) NOT NULL, + 'ProbabilityCollisionSecondaryStructure' REAL NULL, + 'FlowVelocityStructureClosableMean' REAL NULL, + 'StabilityLinearLoadModelMean' REAL NULL, + 'StabilityLinearLoadModelCoefficientOfVariation' REAL NULL, + 'StabilityQuadraticLoadModelMean' REAL NULL, + 'StabilityQuadraticLoadModelCoefficientOfVariation' REAL NULL, + 'AreaFlowAperturesMean' REAL NULL, + 'AreaFlowAperturesStandardDeviation' REAL NULL, + 'InflowModelType' TINYINT (1) NOT NULL, -- Enum: 1 = LowSill, 2 = FloodedCulvert + CONSTRAINT 'FK_StabilityPointStructureEntity_FailureMechanismEntity' FOREIGN KEY ('FailureMechanismEntityId') REFERENCES 'FailureMechanismEntity' ('FailureMechanismEntityId') ON DELETE Cascade ON UPDATE Cascade, + CONSTRAINT 'U_Id_FailureMechanismEntityId' UNIQUE ('FailureMechanismEntityId','Id') +) +; + +CREATE TABLE 'StabilityPointStructuresCalculationEntity' +( + 'StabilityPointStructuresCalculationEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'CalculationGroupEntityId' INTEGER NOT NULL, + 'ForeshoreProfileEntityId' INTEGER NULL, + 'HydraulicLocationEntityId' INTEGER NULL, + 'StabilityPointStructureEntityId' INTEGER NULL, + 'Order' INT (4) NOT NULL, + 'Name' VARCHAR (260) NULL, + 'Comments' TEXT NULL, + 'UseBreakWater' TINYINT (1) NOT NULL, -- true or false + 'BreakWaterType' TINYINT (1) NOT NULL, -- Enum: 1 = Wall, 2 = Caisson, 3 = Dam + 'BreakWaterHeight' REAL NULL, + 'UseForeshore' TINYINT (1) NOT NULL, -- true or false + 'StructureNormalOrientation' REAL NULL, + 'StorageStructureAreaMean' REAL NULL, + 'StorageStructureAreaCoefficientOfVariation' REAL NULL, + 'AllowedLevelIncreaseStorageMean' REAL NULL, + 'AllowedLevelIncreaseStorageStandardDeviation' REAL NULL, + 'WidthFlowAperturesMean' REAL NULL, + 'WidthFlowAperturesStandardDeviation' REAL NULL, + 'InsideWaterLevelMean' REAL NULL, + 'InsideWaterLevelStandardDeviation' REAL NULL, + 'ThresholdHeightOpenWeirMean' REAL NULL, + 'ThresholdHeightOpenWeirStandardDeviation' REAL NULL, + 'CriticalOvertoppingDischargeMean' REAL NULL, + 'CriticalOvertoppingDischargeCoefficientOfVariation' REAL NULL, + 'FlowWidthAtBottomProtectionMean' REAL NULL, + 'FlowWidthAtBottomProtectionStandardDeviation' REAL NULL, + 'ConstructiveStrengthLinearLoadModelMean' REAL NULL, + 'ConstructiveStrengthLinearLoadModelCoefficientOfVariation' REAL NULL, + 'ConstructiveStrengthQuadraticLoadModelMean' REAL NULL, + 'ConstructiveStrengthQuadraticLoadModelCoefficientOfVariation' REAL NULL, + 'BankWidthMean' REAL NULL, + 'BankWidthStandardDeviation' REAL NULL, + 'InsideWaterLevelFailureConstructionMean' REAL NULL, + 'InsideWaterLevelFailureConstructionStandardDeviation' REAL NULL, + 'EvaluationLevel' REAL NULL, + 'LevelCrestStructureMean' REAL NULL, + 'LevelCrestStructureStandardDeviation' REAL NULL, + 'VerticalDistance' REAL NULL, + 'FailureProbabilityRepairClosure' REAL NOT NULL, + 'FailureCollisionEnergyMean' REAL NULL, + 'FailureCollisionEnergyCoefficientOfVariation' REAL NULL, + 'ShipMassMean' REAL NULL, + 'ShipMassCoefficientOfVariation' REAL NULL, + 'ShipVelocityMean' REAL NULL, + 'ShipVelocityCoefficientOfVariation' REAL NULL, + 'LevellingCount' INT (4) NOT NULL, + 'ProbabilityCollisionSecondaryStructure' REAL NOT NULL, + 'FlowVelocityStructureClosableMean' REAL NULL, + 'StabilityLinearLoadModelMean' REAL NULL, + 'StabilityLinearLoadModelCoefficientOfVariation' REAL NULL, + 'StabilityQuadraticLoadModelMean' REAL NULL, + 'StabilityQuadraticLoadModelCoefficientOfVariation' REAL NULL, + 'AreaFlowAperturesMean' REAL NULL, + 'AreaFlowAperturesStandardDeviation' REAL NULL, + 'InflowModelType' TINYINT (1) NOT NULL, -- Enum: 1 = VerticalWall, 2 = LowSill, 3 = FloodedCulvert + 'LoadSchematizationType' TINYINT (1) NOT NULL, -- Enum: 1 = Linear, 2 = Quadratic + 'VolumicWeightWater' REAL NULL, + 'StormDurationMean' REAL NULL, + 'FactorStormDurationOpenStructure' REAL NULL, + 'DrainCoefficientMean' REAL NULL, + 'DrainCoefficientStandardDeviation' REAL NULL, + 'FailureProbabilityStructureWithErosion' REAL NOT NULL, + 'ShouldIllustrationPointsBeCalculated' TINYINT (1) NOT NULL, -- true or false + 'RelevantForScenario' TINYINT (1) NOT NULL, -- true or false + 'ScenarioContribution' REAL NOT NULL, + CONSTRAINT 'FK_StabilityPointStructuresCalculationEntity_CalculationGroupEntity' FOREIGN KEY ('CalculationGroupEntityId') REFERENCES 'CalculationGroupEntity' ('CalculationGroupEntityId') ON DELETE Cascade ON UPDATE Cascade, + CONSTRAINT 'FK_StabilityPointStructuresCalculationEntity_ForeshoreProfileEntity' FOREIGN KEY ('ForeshoreProfileEntityId') REFERENCES 'ForeshoreProfileEntity' ('ForeshoreProfileEntityId') ON DELETE Set Null ON UPDATE Cascade, + CONSTRAINT 'FK_StabilityPointStructuresCalculationEntity_HydraulicLocationEntity' FOREIGN KEY ('HydraulicLocationEntityId') REFERENCES 'HydraulicLocationEntity' ('HydraulicLocationEntityId') ON DELETE Set Null ON UPDATE Cascade, + CONSTRAINT 'FK_StabilityPointStructuresCalculationEntity_StabilityPointStructureEntity' FOREIGN KEY ('StabilityPointStructureEntityId') REFERENCES 'StabilityPointStructureEntity' ('StabilityPointStructureEntityId') ON DELETE Set Null ON UPDATE Cascade +) +; + +CREATE TABLE 'StabilityPointStructuresFailureMechanismMetaEntity' +( + 'StabilityPointStructuresFailureMechanismMetaEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'FailureMechanismEntityId' INTEGER NOT NULL, + 'N' REAL NOT NULL, + 'ForeshoreProfileCollectionSourcePath' TEXT NULL, + 'StabilityPointStructureCollectionSourcePath' TEXT NULL, + CONSTRAINT 'FK_StrengthStabilityPointConstructionFailureMechanismMetaEntity_FailureMechanismEntity' FOREIGN KEY ('FailureMechanismEntityId') REFERENCES 'FailureMechanismEntity' ('FailureMechanismEntityId') ON DELETE Cascade ON UPDATE Cascade +) +; + +CREATE TABLE 'StabilityPointStructuresOutputEntity' +( + 'StabilityPointStructuresOutputEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'StabilityPointStructuresCalculationEntityId' INTEGER NOT NULL, + 'GeneralResultFaultTreeIllustrationPointEntityId' INTEGER NULL, + 'Reliability' REAL NULL, + CONSTRAINT 'FK_StabilityPointStructuresOutputEntity_GeneralResultFaultTreeIllustrationPointEntity' FOREIGN KEY ('GeneralResultFaultTreeIllustrationPointEntityId') REFERENCES 'GeneralResultFaultTreeIllustrationPointEntity' ('GeneralResultFaultTreeIllustrationPointEntityId') ON DELETE Set Null ON UPDATE Cascade, + CONSTRAINT 'FK_StabilityPointStructuresOutputEntity_StabilityPointStructuresCalculationEntity' FOREIGN KEY ('StabilityPointStructuresCalculationEntityId') REFERENCES 'StabilityPointStructuresCalculationEntity' ('StabilityPointStructuresCalculationEntityId') ON DELETE Cascade ON UPDATE Cascade, + CONSTRAINT 'U_StabilityPointStructuresCalculationEntity' UNIQUE ('StabilityPointStructuresCalculationEntityId') +) +; + +CREATE TABLE 'StabilityPointStructuresSectionResultEntity' +( + 'StabilityPointStructuresSectionResultEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'FailureMechanismSectionEntityId' INTEGER NOT NULL, + 'SimpleAssessmentResult' TINYINT (1) NOT NULL, -- Enum: 1 = None, 2 = NotApplicable, 3 = Applicable + 'DetailedAssessmentResult' TINYINT (1) NOT NULL, -- Enum: 1 = Probability, 2 = NotAssessed + 'TailorMadeAssessmentResult' TINYINT (1) NOT NULL, -- Enum: 1 = None, 2 = ProbabilityNegligible, 3 = Probability, 4 = NotAssessed + 'TailorMadeAssessmentProbability' REAL NULL, + 'UseManualAssembly' TINYINT (1) NOT NULL, -- true or false + 'ManualAssemblyProbability' REAL NULL, + CONSTRAINT 'FK_StabilityPointStructuresSectionResultEntity_FailureMechanismSectionEntity' FOREIGN KEY ('FailureMechanismSectionEntityId') REFERENCES 'FailureMechanismSectionEntity' ('FailureMechanismSectionEntityId') ON DELETE Cascade ON UPDATE Cascade +) +; + +CREATE TABLE 'StabilityStoneCoverFailureMechanismMetaEntity' +( + 'StabilityStoneCoverFailureMechanismMetaEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'FailureMechanismEntityId' INTEGER NOT NULL, + 'ForeshoreProfileCollectionSourcePath' TEXT NULL, + 'N' REAL NOT NULL, + CONSTRAINT 'FK_StabilityStoneCoverFailureMechanismMetaEntity_FailureMechanismEntity' FOREIGN KEY ('FailureMechanismEntityId') REFERENCES 'FailureMechanismEntity' ('FailureMechanismEntityId') ON DELETE Cascade ON UPDATE Cascade +) +; + +CREATE TABLE 'StabilityStoneCoverSectionResultEntity' +( + 'StabilityStoneCoverSectionResultEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'FailureMechanismSectionEntityId' INTEGER NOT NULL, + 'SimpleAssessmentResult' TINYINT (1) NOT NULL, -- Enum: 1 = None, 2 = NotApplicable, 3 = Applicable + 'DetailedAssessmentResultForFactorizedSignalingNorm' TINYINT (1) NOT NULL, -- Enum: 1 = None, 2 = Sufficient, 3 = Insufficient, 4 = NotAssessed + 'DetailedAssessmentResultForSignalingNorm' TINYINT (1) NOT NULL, -- Enum: 1 = None, 2 = Sufficient, 3 = Insufficient, 4 = NotAssessed + 'DetailedAssessmentResultForMechanismSpecificLowerLimitNorm' TINYINT (1) NOT NULL, -- Enum: 1 = None, 2 = Sufficient, 3 = Insufficient, 4 = NotAssessed + 'DetailedAssessmentResultForLowerLimitNorm' TINYINT (1) NOT NULL, -- Enum: 1 = None, 2 = Sufficient, 3 = Insufficient, 4 = NotAssessed + 'DetailedAssessmentResultForFactorizedLowerLimitNorm' TINYINT (1) NOT NULL, -- Enum: 1 = None, 2 = Sufficient, 3 = Insufficient, 4 = NotAssessed + 'TailorMadeAssessmentResult' TINYINT (1) NOT NULL, -- Enum: 1 = None, 2 = Iv, 3 = IIv, 4 = IIIv, 5 = IVv, 6 = Vv, 7 = VIv, 8 = VIIv + 'UseManualAssembly' TINYINT (1) NOT NULL, -- true or false + 'ManualAssemblyCategoryGroup' TINYINT (1) NOT NULL, -- Enum: 1 = None, 2 = NotApplicable 3 = Iv, 4 = IIv, 5 = IIIv, 6 = IVv, 7 = Vv, 8 = VIv, 9 = VIIv + CONSTRAINT 'FK_StabilityStoneCoverSectionResultEntity_FailureMechanismSectionEntity' FOREIGN KEY ('FailureMechanismSectionEntityId') REFERENCES 'FailureMechanismSectionEntity' ('FailureMechanismSectionEntityId') ON DELETE Cascade ON UPDATE Cascade +) +; + +CREATE TABLE 'StabilityStoneCoverWaveConditionsCalculationEntity' +( + 'StabilityStoneCoverWaveConditionsCalculationEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'CalculationGroupEntityId' INTEGER NOT NULL, + 'ForeshoreProfileEntityId' INTEGER NULL, + 'HydraulicLocationEntityId' INTEGER NULL, + 'Order' INT (4) NOT NULL, + 'Name' VARCHAR (260) NULL, + 'Comments' TEXT NULL, + 'UseBreakWater' TINYINT (1) NOT NULL, -- true or false + 'BreakWaterType' TINYINT (1) NOT NULL, -- Enum: 1 = Wall, 2 = Caisson, 3 = Dam + 'BreakWaterHeight' REAL NULL, + 'UseForeshore' TINYINT (1) NOT NULL, -- true or false + 'Orientation' REAL NULL, + 'UpperBoundaryRevetment' REAL NULL, + 'LowerBoundaryRevetment' REAL NULL, + 'UpperBoundaryWaterLevels' REAL NULL, + 'LowerBoundaryWaterLevels' REAL NULL, + 'StepSize' TINYINT (1) NOT NULL, -- Enum: 1 = 0.5, 2 = 1.0, 3 = 2.0 + 'CategoryType' TINYINT (1) NOT NULL, -- Enum: 1 = FactorizedSignalingNorm, 2 = SignalingNorm, 3 = LowerLimitNorm, 4 = FactorizedLowerLimitNorm + 'CalculationType' TINYINT (1) NOT NULL, -- Enum: 1 = Blocks, 2 = Columns, 3 = Both + CONSTRAINT 'FK_StabilityStoneCoverWaveConditionsCalculationEntity_CalculationGroupEntity' FOREIGN KEY ('CalculationGroupEntityId') REFERENCES 'CalculationGroupEntity' ('CalculationGroupEntityId') ON DELETE Cascade ON UPDATE Cascade, + CONSTRAINT 'FK_StabilityStoneCoverWaveConditionsCalculationEntity_ForeshoreProfileEntity' FOREIGN KEY ('ForeshoreProfileEntityId') REFERENCES 'ForeshoreProfileEntity' ('ForeshoreProfileEntityId') ON DELETE Set Null ON UPDATE Cascade, + CONSTRAINT 'FK_StabilityStoneCoverWaveConditionsCalculationEntity_HydraulicLocationEntity' FOREIGN KEY ('HydraulicLocationEntityId') REFERENCES 'HydraulicLocationEntity' ('HydraulicLocationEntityId') ON DELETE Set Null ON UPDATE Cascade +) +; + +CREATE TABLE 'StabilityStoneCoverWaveConditionsOutputEntity' +( + 'StabilityStoneCoverWaveConditionsOutputEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'StabilityStoneCoverWaveConditionsCalculationEntityId' INTEGER NOT NULL, + 'Order' INT (4) NOT NULL, + 'OutputType' TINYINT (1) NOT NULL, -- Enum: 1 = Column, 2 = Block + 'WaterLevel' REAL NULL, + 'WaveHeight' REAL NULL, + 'WavePeakPeriod' REAL NULL, + 'WaveAngle' REAL NULL, + 'WaveDirection' REAL NULL, + 'TargetProbability' REAL NULL, + 'TargetReliability' REAL NULL, + 'CalculatedProbability' REAL NULL, + 'CalculatedReliability' REAL NULL, + 'CalculationConvergence' TINYINT (1) NOT NULL, -- Enum: 1 = NotCalculated, 2 = CalculationNotConverged, 3 = CalculationConverged + CONSTRAINT 'FK_StabilityStoneCoverWaveConditionsOutputEntity_StabilityStoneCoverWaveConditionsCalculationEntity' FOREIGN KEY ('StabilityStoneCoverWaveConditionsCalculationEntityId') REFERENCES 'StabilityStoneCoverWaveConditionsCalculationEntity' ('StabilityStoneCoverWaveConditionsCalculationEntityId') ON DELETE Cascade ON UPDATE Cascade +) +; + +CREATE TABLE 'StochastEntity' +( + 'StochastEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'Name' TEXT NOT NULL, + 'Duration' REAL NOT NULL, + 'Alpha' REAL NOT NULL, + 'Order' INT (4) NOT NULL +) +; + +CREATE TABLE 'StrengthStabilityLengthwiseConstructionSectionResultEntity' +( + 'StrengthStabilityLengthwiseConstructionSectionResultEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'FailureMechanismSectionEntityId' INTEGER NOT NULL, + 'SimpleAssessmentResult' TINYINT (1) NOT NULL, -- Enum: 1 = None, 2 = NotApplicable, 3 = ProbabilityNegligible, 4 = AssessFurther + 'TailorMadeAssessmentResult' TINYINT (1) NOT NULL, -- Enum: 1 = None, 2 = ProbabilityNegligible, 3 = Sufficient, 4 = Insufficient, 5 = NotAssessed + 'UseManualAssembly' TINYINT (1) NOT NULL, -- true or false + 'ManualAssemblyCategoryGroup' TINYINT (1) NOT NULL, -- Enum: 1 = None, 2 = NotApplicable, 3 = Iv, 4 = IIv, 5 = Vv, 6 = VIIv + CONSTRAINT 'FK_StrengthStabilityLengthwiseConstructionSectionResultEntity_FailureMechanismSectionEntity' FOREIGN KEY ('FailureMechanismSectionEntityId') REFERENCES 'FailureMechanismSectionEntity' ('FailureMechanismSectionEntityId') ON DELETE Cascade ON UPDATE Cascade +) +; + +CREATE TABLE 'SubMechanismIllustrationPointEntity' +( + 'SubMechanismIllustrationPointEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'Name' TEXT NOT NULL, + 'Beta' REAL NOT NULL, + 'Order' INT (4) NOT NULL +) +; + +CREATE TABLE 'SubMechanismIllustrationPointStochastEntity' +( + 'SubMechanismIllustrationPointStochastEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'SubMechanismIllustrationPointEntityId' INTEGER NOT NULL, + 'Name' TEXT NOT NULL, + 'Unit' TEXT NOT NULL, + 'Duration' REAL NOT NULL, + 'Alpha' REAL NOT NULL, + 'Realization' REAL NOT NULL, + 'Order' INT (4) NOT NULL, + CONSTRAINT 'FK_SubMechanismIllustrationPointStochast_SubMechanismIllustrationPointEntity' FOREIGN KEY ('SubMechanismIllustrationPointEntityId') REFERENCES 'SubMechanismIllustrationPointEntity' ('SubMechanismIllustrationPointEntityId') ON DELETE No Action ON UPDATE No Action +) +; + +CREATE TABLE 'TechnicalInnovationSectionResultEntity' +( + 'TechnicalInnovationSectionResultEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'FailureMechanismSectionEntityId' INTEGER NOT NULL, + 'SimpleAssessmentResult' TINYINT (1) NOT NULL, -- Enum: 1 = None, 2 = NotApplicable, 3 = ProbabilityNegligible, 4 = AssessFurther + 'TailorMadeAssessmentResult' TINYINT (1) NOT NULL, -- Enum: 1 = None, 2 = ProbabilityNegligible, 3 = Sufficient, 4 = Insufficient, 5 = NotAssessed + 'UseManualAssembly' TINYINT (1) NOT NULL, -- true or false + 'ManualAssemblyCategoryGroup' TINYINT (1) NOT NULL, -- Enum: 1 = None, 2 = NotApplicable, 3 = Iv, 4 = IIv, 5 = Vv, 6 = VIIv + CONSTRAINT 'FK_TechnicalInnovationSectionResultEntity_FailureMechanismSectionEntity' FOREIGN KEY ('FailureMechanismSectionEntityId') REFERENCES 'FailureMechanismSectionEntity' ('FailureMechanismSectionEntityId') ON DELETE Cascade ON UPDATE Cascade +) +; + +CREATE TABLE 'TopLevelFaultTreeIllustrationPointEntity' +( + 'TopLevelFaultTreeIllustrationPointEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'FaultTreeIllustrationPointEntityId' INTEGER NOT NULL, + 'GeneralResultFaultTreeIllustrationPointEntityId' INTEGER NOT NULL, + 'ClosingSituation' TEXT NOT NULL, + 'WindDirectionName' TEXT NOT NULL, + 'WindDirectionAngle' REAL NOT NULL, + 'Order' INT (4) NOT NULL, + CONSTRAINT 'FK_TopLevelFaultTreeIllustrationPointEntity_FaultTreeIllustrationPointEntity' FOREIGN KEY ('FaultTreeIllustrationPointEntityId') REFERENCES 'FaultTreeIllustrationPointEntity' ('FaultTreeIllustrationPointEntityId') ON DELETE Cascade ON UPDATE Cascade, + CONSTRAINT 'FK_TopLevelFaultTreeIllustrationPointEntity_GeneralResultFaultTreeIllustrationPointEntity' FOREIGN KEY ('GeneralResultFaultTreeIllustrationPointEntityId') REFERENCES 'GeneralResultFaultTreeIllustrationPointEntity' ('GeneralResultFaultTreeIllustrationPointEntityId') ON DELETE Cascade ON UPDATE Cascade +) +; + +CREATE TABLE 'TopLevelSubMechanismIllustrationPointEntity' +( + 'TopLevelSubMechanismIllustrationPointEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'GeneralResultSubMechanismIllustrationPointEntityId' INTEGER NOT NULL, + 'SubMechanismIllustrationPointEntityId' INTEGER NOT NULL, + 'ClosingSituation' TEXT NOT NULL, + 'WindDirectionName' TEXT NOT NULL, + 'WindDirectionAngle' REAL NOT NULL, + 'Order' INT (4) NOT NULL, + CONSTRAINT 'FK_TopLevelSubMechanismIllustrationPointEntity_GeneralResultSubMechanismIllustrationPointEntity' FOREIGN KEY ('GeneralResultSubMechanismIllustrationPointEntityId') REFERENCES 'GeneralResultSubMechanismIllustrationPointEntity' ('GeneralResultSubMechanismIllustrationPointEntityId') ON DELETE Cascade ON UPDATE Cascade, + CONSTRAINT 'FK_TopLevelSubMechanismIllustrationPointEntity_SubMechanismIllustrationPointEntity' FOREIGN KEY ('SubMechanismIllustrationPointEntityId') REFERENCES 'SubMechanismIllustrationPointEntity' ('SubMechanismIllustrationPointEntityId') ON DELETE Cascade ON UPDATE Cascade +) +; + +CREATE TABLE 'WaterPressureAsphaltCoverSectionResultEntity' +( + 'WaterPressureAsphaltCoverSectionResultEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'FailureMechanismSectionEntityId' INTEGER NOT NULL, + 'SimpleAssessmentResult' TINYINT (1) NOT NULL, -- Enum: 1 = None, 2 = NotApplicable, 3 = ProbabilityNegligible, 4 = AssessFurther + 'TailorMadeAssessmentResult' TINYINT (1) NOT NULL, -- Enum: 1 = None, 2 = ProbabilityNegligible, 3 = Sufficient, 4 = Insufficient, 5 = NotAssessed + 'UseManualAssembly' TINYINT (1) NOT NULL, -- true or false + 'ManualAssemblyCategoryGroup' TINYINT (1) NOT NULL, -- Enum: 1 = None, 2 = NotApplicable, 3 = Iv, 4 = IIv, 5 = Vv, 6 = VIIv + CONSTRAINT 'FK_WaterPressureAsphaltCoverSectionResultEntity_FailureMechanismSectionEntity' FOREIGN KEY ('FailureMechanismSectionEntityId') REFERENCES 'FailureMechanismSectionEntity' ('FailureMechanismSectionEntityId') ON DELETE Cascade ON UPDATE Cascade +) +; + +CREATE TABLE 'WaveImpactAsphaltCoverSectionResultEntity' +( + 'WaveImpactAsphaltCoverSectionResultEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'FailureMechanismSectionEntityId' INTEGER NOT NULL, + 'SimpleAssessmentResult' TINYINT (1) NOT NULL, -- Enum: 1 = None, 2 = NotApplicable, 3 = ProbabilityNegligible, 4 = AssessFurther + 'DetailedAssessmentResultForFactorizedSignalingNorm' TINYINT (1) NOT NULL, -- Enum: 1 = None, 2 = Sufficient, 3 = Insufficient, 4 = NotAssessed + 'DetailedAssessmentResultForSignalingNorm' TINYINT (1) NOT NULL, -- Enum: 1 = None, 2 = Sufficient, 3 = Insufficient, 4 = NotAssessed + 'DetailedAssessmentResultForMechanismSpecificLowerLimitNorm' TINYINT (1) NOT NULL, -- Enum: 1 = None, 2 = Sufficient, 3 = Insufficient, 4 = NotAssessed + 'DetailedAssessmentResultForLowerLimitNorm' TINYINT (1) NOT NULL, -- Enum: 1 = None, 2 = Sufficient, 3 = Insufficient, 4 = NotAssessed + 'DetailedAssessmentResultForFactorizedLowerLimitNorm' TINYINT (1) NOT NULL, -- Enum: 1 = None, 2 = Sufficient, 3 = Insufficient, 4 = NotAssessed + 'TailorMadeAssessmentResult' TINYINT (1) NOT NULL, -- Enum: 1 = None, 2 = Iv, 3 = IIv, 4 = IIIv, 5 = IVv, 6 = Vv, 7 = VIv, 8 = VIIv + 'UseManualAssembly' TINYINT (1) NOT NULL, -- true or false + 'ManualAssemblyCategoryGroup' TINYINT (1) NOT NULL, -- Enum: 1 = None, 2 = NotApplicable 3 = Iv, 4 = IIv, 5 = IIIv, 6 = IVv, 7 = Vv, 8 = VIv, 9 = VIIv + CONSTRAINT 'FK_WaveImpactAsphaltCoverSectionResultEntity_FailureMechanismSectionEntity' FOREIGN KEY ('FailureMechanismSectionEntityId') REFERENCES 'FailureMechanismSectionEntity' ('FailureMechanismSectionEntityId') ON DELETE Cascade ON UPDATE Cascade +) +; + +CREATE TABLE 'WaveImpactAsphaltCoverWaveConditionsCalculationEntity' +( + 'WaveImpactAsphaltCoverWaveConditionsCalculationEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'CalculationGroupEntityId' INTEGER NOT NULL, + 'ForeshoreProfileEntityId' INTEGER NULL, + 'HydraulicLocationEntityId' INTEGER NULL, + 'Order' INT (4) NOT NULL, + 'Name' VARCHAR (260) NULL, + 'Comments' TEXT NULL, + 'UseBreakWater' TINYINT (1) NOT NULL, -- true or false + 'BreakWaterType' TINYINT (1) NOT NULL, -- Enum: 1 = Wall, 2 = Caisson, 3 = Dam + 'BreakWaterHeight' REAL NULL, + 'UseForeshore' TINYINT (1) NOT NULL, -- true or false + 'Orientation' REAL NULL, + 'UpperBoundaryRevetment' REAL NULL, + 'LowerBoundaryRevetment' REAL NULL, + 'UpperBoundaryWaterLevels' REAL NULL, + 'LowerBoundaryWaterLevels' REAL NULL, + 'StepSize' TINYINT (1) NOT NULL, -- Enum: 1 = 0.5, 2 = 1.0, 3 = 2.0 + 'CategoryType' TINYINT (1) NOT NULL, -- Enum: 1 = FactorizedSignalingNorm, 2 = SignalingNorm, 3 = LowerLimitNorm, 4 = FactorizedLowerLimitNorm + CONSTRAINT 'FK_WaveImpactAsphaltCoverWaveConditionsCalculationEntity_CalculationGroupEntity' FOREIGN KEY ('CalculationGroupEntityId') REFERENCES 'CalculationGroupEntity' ('CalculationGroupEntityId') ON DELETE Cascade ON UPDATE Cascade, + CONSTRAINT 'FK_WaveImpactAsphaltCoverWaveConditionsCalculationEntity_ForeshoreProfileEntity' FOREIGN KEY ('ForeshoreProfileEntityId') REFERENCES 'ForeshoreProfileEntity' ('ForeshoreProfileEntityId') ON DELETE Set Null ON UPDATE Cascade, + CONSTRAINT 'FK_WaveImpactAsphaltCoverWaveConditionsCalculationEntity_HydraulicLocationEntity' FOREIGN KEY ('HydraulicLocationEntityId') REFERENCES 'HydraulicLocationEntity' ('HydraulicLocationEntityId') ON DELETE Set Null ON UPDATE Cascade +) +; + +CREATE TABLE 'WaveImpactAsphaltCoverWaveConditionsOutputEntity' +( + 'WaveImpactAsphaltCoverWaveConditionsOutputEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'WaveImpactAsphaltCoverWaveConditionsCalculationEntityId' INTEGER NOT NULL, + 'Order' INT (4) NOT NULL, + 'WaterLevel' REAL NULL, + 'WaveHeight' REAL NULL, + 'WavePeakPeriod' REAL NULL, + 'WaveAngle' REAL NULL, + 'WaveDirection' REAL NULL, + 'TargetProbability' REAL NULL, + 'TargetReliability' REAL NULL, + 'CalculatedProbability' REAL NULL, + 'CalculatedReliability' REAL NULL, + 'CalculationConvergence' TINYINT (1) NOT NULL, -- Enum: 1 = NotCalculated, 2 = CalculationNotConverged, 3 = CalculationConverged + CONSTRAINT 'FK_WaveImpactAsphaltCoverWaveConditionsOutputEntity_WaveImpactAsphaltCoverWaveConditionsCalculationEntity' FOREIGN KEY ('WaveImpactAsphaltCoverWaveConditionsCalculationEntityId') REFERENCES 'WaveImpactAsphaltCoverWaveConditionsCalculationEntity' ('WaveImpactAsphaltCoverWaveConditionsCalculationEntityId') ON DELETE Cascade ON UPDATE Cascade +) +; + +/* Create Indexes and Triggers */ + +CREATE INDEX 'IXFK_AssessmentSectionEntity_HydraulicLocationCalculationCollectionEntity1' + ON 'AssessmentSectionEntity' ('HydraulicLocationCalculationCollectionEntity1Id' ASC) +; + +CREATE INDEX 'IXFK_AssessmentSectionEntity_HydraulicLocationCalculationCollectionEntity2' + ON 'AssessmentSectionEntity' ('HydraulicLocationCalculationCollectionEntity2Id' ASC) +; + +CREATE INDEX 'IXFK_AssessmentSectionEntity_HydraulicLocationCalculationCollectionEntity3' + ON 'AssessmentSectionEntity' ('HydraulicLocationCalculationCollectionEntity3Id' ASC) +; + +CREATE INDEX 'IXFK_AssessmentSectionEntity_HydraulicLocationCalculationCollectionEntity4' + ON 'AssessmentSectionEntity' ('HydraulicLocationCalculationCollectionEntity4Id' ASC) +; + +CREATE INDEX 'IXFK_AssessmentSectionEntity_HydraulicLocationCalculationCollectionEntity5' + ON 'AssessmentSectionEntity' ('HydraulicLocationCalculationCollectionEntity5Id' ASC) +; + +CREATE INDEX 'IXFK_AssessmentSectionEntity_HydraulicLocationCalculationCollectionEntity6' + ON 'AssessmentSectionEntity' ('HydraulicLocationCalculationCollectionEntity6Id' ASC) +; + +CREATE INDEX 'IXFK_AssessmentSectionEntity_HydraulicLocationCalculationCollectionEntity7' + ON 'AssessmentSectionEntity' ('HydraulicLocationCalculationCollectionEntity7Id' ASC) +; + +CREATE INDEX 'IXFK_AssessmentSectionEntity_HydraulicLocationCalculationCollectionEntity8' + ON 'AssessmentSectionEntity' ('HydraulicLocationCalculationCollectionEntity8Id' ASC) +; + +CREATE INDEX 'IXFK_AssessmentSectionEntity_ProjectEntity' + ON 'AssessmentSectionEntity' ('ProjectEntityId' 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_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_ClosingStructuresFailureMechanismMetaEntity_FailureMechanismEntity' + ON 'ClosingStructuresFailureMechanismMetaEntity' ('FailureMechanismEntityId' ASC) +; + +CREATE INDEX 'IXFK_CalculationGroupEntity_CalculationGroupEntity' + ON 'CalculationGroupEntity' ('ParentCalculationGroupEntityId' ASC) +; + +CREATE INDEX 'IXFK_HydraulicLocationEntity_AssessmentSectionEntity' + ON 'HydraulicLocationEntity' ('AssessmentSectionEntityId' ASC) +; + +CREATE INDEX 'IXFK_GrassCoverErosionInwardsFailureMechanismMetaEntity_FailureMechanismEntity' + ON 'GrassCoverErosionInwardsFailureMechanismMetaEntity' ('FailureMechanismEntityId' ASC) +; + +CREATE INDEX 'IXFK_SemiProbabilisticPipingCalculationEntity_PipingStochasticSoilProfileEntity' + ON 'SemiProbabilisticPipingCalculationEntity' ('PipingStochasticSoilProfileEntityId' ASC) +; + +CREATE INDEX 'IXFK_SemiProbabilisticPipingCalculationEntity_SurfaceLineEntity' + ON 'SemiProbabilisticPipingCalculationEntity' ('SurfaceLineEntityId' ASC) +; + +CREATE INDEX 'IXFK_SemiProbabilisticPipingCalculationEntity_HydraulicLocationEntity' + ON 'SemiProbabilisticPipingCalculationEntity' ('HydraulicLocationEntityId' ASC) +; + +CREATE INDEX 'IXFK_SemiProbabilisticPipingCalculationEntity_CalculationGroupEntity' + ON 'SemiProbabilisticPipingCalculationEntity' ('CalculationGroupEntityId' ASC) +; + +CREATE INDEX 'IXFK_GrassCoverErosionInwardsCalculationEntity_CalculationGroupEntity' + ON 'GrassCoverErosionInwardsCalculationEntity' ('CalculationGroupEntityId' ASC) +; + +CREATE INDEX 'IXFK_GrassCoverErosionInwardsCalculationEntity_DikeProfileEntity' + ON 'GrassCoverErosionInwardsCalculationEntity' ('DikeProfileEntityId' ASC) +; + +CREATE INDEX 'IXFK_GrassCoverErosionInwardsCalculationEntity_HydraulicLocationEntity' + ON 'GrassCoverErosionInwardsCalculationEntity' ('HydraulicLocationEntityId' ASC) +; + +CREATE INDEX 'IXFK_GrassCoverErosionOutwardsFailureMechanismMetaEntity_FailureMechanismEntity' + ON 'GrassCoverErosionOutwardsFailureMechanismMetaEntity' ('FailureMechanismEntityId' ASC) +; + +CREATE INDEX 'IXFK_GrassCoverErosionOutwardsFailureMechanismMetaEntity_HydraulicLocationCalculationCollectionEntity1' + ON 'GrassCoverErosionOutwardsFailureMechanismMetaEntity' ('HydraulicLocationCalculationCollectionEntity1Id' ASC) +; + +CREATE INDEX 'IXFK_GrassCoverErosionOutwardsFailureMechanismMetaEntity_HydraulicLocationCalculationCollectionEntity2' + ON 'GrassCoverErosionOutwardsFailureMechanismMetaEntity' ('HydraulicLocationCalculationCollectionEntity2Id' ASC) +; + +CREATE INDEX 'IXFK_GrassCoverErosionOutwardsFailureMechanismMetaEntity_HydraulicLocationCalculationCollectionEntity3' + ON 'GrassCoverErosionOutwardsFailureMechanismMetaEntity' ('HydraulicLocationCalculationCollectionEntity3Id' ASC) +; + +CREATE INDEX 'IXFK_GrassCoverErosionOutwardsFailureMechanismMetaEntity_HydraulicLocationCalculationCollectionEntity4' + ON 'GrassCoverErosionOutwardsFailureMechanismMetaEntity' ('HydraulicLocationCalculationCollectionEntity4Id' ASC) +; + +CREATE INDEX 'IXFK_GrassCoverErosionOutwardsFailureMechanismMetaEntity_HydraulicLocationCalculationCollectionEntity5' + ON 'GrassCoverErosionOutwardsFailureMechanismMetaEntity' ('HydraulicLocationCalculationCollectionEntity5Id' ASC) +; + +CREATE INDEX 'IXFK_GrassCoverErosionOutwardsFailureMechanismMetaEntity_HydraulicLocationCalculationCollectionEntity6' + ON 'GrassCoverErosionOutwardsFailureMechanismMetaEntity' ('HydraulicLocationCalculationCollectionEntity6Id' ASC) +; +CREATE TRIGGER [TR_AfterDeleteGrassCoverErosionOutwardsFailureMechanismMetaEntity_RemoveHydraulicLocationCalculationCollectionEntities] + AFTER DELETE + ON GrassCoverErosionOutwardsFailureMechanismMetaEntity + 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_PipingStochasticSoilProfileEntity_SoilProfileEntity' + ON 'PipingStochasticSoilProfileEntity' ('PipingSoilProfileEntityId' ASC) +; + +CREATE INDEX 'IXFK_PipingStochasticSoilProfileEntity_StochasticSoilModelEntity' + ON 'PipingStochasticSoilProfileEntity' ('StochasticSoilModelEntityId' ASC) +; + +CREATE INDEX 'IXFK_StochasticSoilModelEntity_FailureMechanismEntity' + ON 'StochasticSoilModelEntity' ('FailureMechanismEntityId' ASC) +; + +CREATE INDEX 'IXFK_SurfaceLineEntity_FailureMechanismEntity' + ON 'SurfaceLineEntity' ('FailureMechanismEntityId' ASC) +; + +CREATE INDEX 'IXFK_SurfaceLinePointEntity_SurfaceLineEntity' + ON 'PipingCharacteristicPointEntity' ('SurfaceLineEntityId' ASC) +; + +CREATE INDEX 'IXFK_WaveImpactAsphaltCoverFailureMechanismMetaEntity_FailureMechanismEntity' + ON 'WaveImpactAsphaltCoverFailureMechanismMetaEntity' ('FailureMechanismEntityId' ASC) +; + +CREATE INDEX 'IXFK_BackgroundDataEntity_AssessmentSectionEntity' + ON 'BackgroundDataEntity' ('AssessmentSectionEntityId' ASC) +; + +CREATE INDEX 'IXFK_BackgroundDataMetaEntity_BackgroundDataEntity' + ON 'BackgroundDataMetaEntity' ('BackgroundDataEntityId' ASC) +; + +CREATE INDEX 'IXFK_ClosingStructureEntity_FailureMechanismEntity' + ON 'ClosingStructureEntity' ('FailureMechanismEntityId' ASC) +; + +CREATE INDEX 'IXFK_ClosingStructuresCalculationEntity_CalculationGroupEntity' + ON 'ClosingStructuresCalculationEntity' ('CalculationGroupEntityId' ASC) +; + +CREATE INDEX 'IXFK_ClosingStructuresCalculationEntity_ClosingStructureEntity' + ON 'ClosingStructuresCalculationEntity' ('ClosingStructureEntityId' ASC) +; + +CREATE INDEX 'IXFK_ClosingStructuresCalculationEntity_ForeshoreProfileEntity' + ON 'ClosingStructuresCalculationEntity' ('ForeshoreProfileEntityId' ASC) +; + +CREATE INDEX 'IXFK_ClosingStructuresCalculationEntity_HydraulicLocationEntity' + ON 'ClosingStructuresCalculationEntity' ('HydraulicLocationEntityId' ASC) +; + +CREATE INDEX 'IXFK_ClosingStructuresOutputEntity_ClosingStructuresCalculationEntity' + ON 'ClosingStructuresOutputEntity' ('ClosingStructuresCalculationEntityId' ASC) +; +CREATE TRIGGER [TR_AfterDeleteClosingStructuresOutputEntity_RemoveGeneralResultFaultTreeIllustrationPointEntity] + AFTER DELETE + ON ClosingStructuresOutputEntity + FOR EACH ROW +BEGIN + DELETE + FROM GeneralResultFaultTreeIllustrationPointEntity + WHERE OLD.GeneralResultFaultTreeIllustrationPointEntityId IS NOT NULL + AND GeneralResultFaultTreeIllustrationPointEntityId IS OLD.GeneralResultFaultTreeIllustrationPointEntityId; +END; +; + +CREATE INDEX 'IXFK_ClosingStructuresSectionResultEntity_FailureMechanismSectionEntity' + ON 'ClosingStructuresSectionResultEntity' ('FailureMechanismSectionEntityId' ASC) +; + +CREATE INDEX 'IXFK_DikeProfileEntity_FailureMechanismEntity' + ON 'DikeProfileEntity' ('FailureMechanismEntityId' ASC) +; + +CREATE INDEX 'IXFK_DuneErosionFailureMechanismMetaEntity_DuneLocationCalculationCollectionEntity1' + ON 'DuneErosionFailureMechanismMetaEntity' ('DuneLocationCalculationCollectionEntity1Id' ASC) +; + +CREATE INDEX 'IXFK_DuneErosionFailureMechanismMetaEntity_DuneLocationCalculationCollectionEntity2' + ON 'DuneErosionFailureMechanismMetaEntity' ('DuneLocationCalculationCollectionEntity2Id' ASC) +; + +CREATE INDEX 'IXFK_DuneErosionFailureMechanismMetaEntity_DuneLocationCalculationCollectionEntity3' + ON 'DuneErosionFailureMechanismMetaEntity' ('DuneLocationCalculationCollectionEntity3Id' ASC) +; + +CREATE INDEX 'IXFK_DuneErosionFailureMechanismMetaEntity_DuneLocationCalculationCollectionEntity4' + ON 'DuneErosionFailureMechanismMetaEntity' ('DuneLocationCalculationCollectionEntity4Id' ASC) +; + +CREATE INDEX 'IXFK_DuneErosionFailureMechanismMetaEntity_DuneLocationCalculationCollectionEntity5' + ON 'DuneErosionFailureMechanismMetaEntity' ('DuneLocationCalculationCollectionEntity5Id' ASC) +; + +CREATE INDEX 'IXFK_DuneErosionFailureMechanismMetaEntity_FailureMechanismEntity' + ON 'DuneErosionFailureMechanismMetaEntity' ('FailureMechanismEntityId' ASC) +; +CREATE TRIGGER [TR_AfterDeleteDuneErosionFailureMechanismMetaEntity_RemoveDuneLocationCalculationCollectionEntities] + AFTER DELETE + ON DuneErosionFailureMechanismMetaEntity + FOR EACH ROW +BEGIN + DELETE + FROM DuneLocationCalculationCollectionEntity + WHERE DuneLocationCalculationCollectionEntityId IS OLD.DuneLocationCalculationCollectionEntity1Id + OR DuneLocationCalculationCollectionEntityId IS OLD.DuneLocationCalculationCollectionEntity2Id + OR DuneLocationCalculationCollectionEntityId IS OLD.DuneLocationCalculationCollectionEntity3Id + OR DuneLocationCalculationCollectionEntityId IS OLD.DuneLocationCalculationCollectionEntity4Id + OR DuneLocationCalculationCollectionEntityId IS OLD.DuneLocationCalculationCollectionEntity5Id; +END; +; + +CREATE INDEX 'IXFK_DuneErosionSectionResultEntity_FailureMechanismSectionEntity' + ON 'DuneErosionSectionResultEntity' ('FailureMechanismSectionEntityId' ASC) +; + +CREATE INDEX 'IXFK_DuneLocationCalculationEntity_DuneLocationCalculationCollectionEntity' + ON 'DuneLocationCalculationEntity' ('DuneLocationCalculationCollectionEntityId' ASC) +; + +CREATE INDEX 'IXFK_DuneLocationCalculationEntity_DuneLocationEntity' + ON 'DuneLocationCalculationEntity' ('DuneLocationEntityId' ASC) +; + +CREATE INDEX 'IXFK_DuneLocationCalculationOutputEntity_DuneLocationCalculationEntity' + ON 'DuneLocationCalculationOutputEntity' ('DuneLocationCalculationEntityId' ASC) +; + +CREATE INDEX 'IXFK_DuneLocationEntity_FailureMechanismEntity' + ON 'DuneLocationEntity' ('FailureMechanismEntityId' ASC) +; + +CREATE INDEX 'IXFK_FaultTreeIllustrationPoint_FaultTreeIllustrationPoint' + ON 'FaultTreeIllustrationPointEntity' ('ParentFaultTreeIllustrationPointEntityId' ASC) +; + +CREATE INDEX 'IXFK_FaultTreeIllustrationPointStochastEntity_FaultTreeIllustrationPoint' + ON 'FaultTreeIllustrationPointStochastEntity' ('FaultTreeIllustrationPointEntityId' ASC) +; + +CREATE INDEX 'IXFK_FaultTreeIllustrationPointStochastEntity_StochastEntity' + ON 'FaultTreeIllustrationPointStochastEntity' ('StochastEntityId' ASC) +; +CREATE TRIGGER [TR_AfterDeleteFaultTreeIllustrationPointStochastEntity_RemoveStochastEntity] + AFTER DELETE + ON FaultTreeIllustrationPointStochastEntity + FOR EACH ROW +BEGIN + DELETE + FROM StochastEntity + WHERE OLD.StochastEntityId IS NOT NULL + AND StochastEntityId IS OLD.StochastEntityId; +END; +; + +CREATE INDEX 'IXFK_FaultTreeIllustrationPointEntity_FaultTreeIllustrationPointEntity' + ON 'FaultTreeSubmechanismIllustrationPointEntity' ('FaultTreeIllustrationPointEntityId' ASC) +; + +CREATE INDEX 'IXFK_FaultTreeIllustrationPointEntity_SubMechanismIllustrationPointEntity' + ON 'FaultTreeSubmechanismIllustrationPointEntity' ('SubMechanismIllustrationPointEntityId' ASC) +; +CREATE TRIGGER [TR_AfterDeleteFaultTreeSubmechanismIllustrationPointEntity_RemoveSubmechanismIllustrationPointEntity] + AFTER DELETE + ON FaultTreeSubmechanismIllustrationPointEntity + FOR EACH ROW +BEGIN + DELETE + FROM SubmechanismIllustrationPointEntity + WHERE OLD.SubmechanismIllustrationPointEntityId IS NOT NULL + AND SubmechanismIllustrationPointEntityId IS OLD.SubmechanismIllustrationPointEntityId; +END; +; + +CREATE INDEX 'IXFK_ForeshoreProfileEntity_FailureMechanismEntity' + ON 'ForeshoreProfileEntity' ('FailureMechanismEntityId' ASC) +; + +CREATE INDEX 'IXFK_GeneralResultFaultTreeIllustrationPointStochastEntity_GeneralResultFaultTreeIllustrationPointEntity' + ON 'GeneralResultFaultTreeIllustrationPointStochastEntity' ('GeneralResultFaultTreeIllustrationPointEntityId' ASC) +; + +CREATE INDEX 'IXFK_GeneralResultFaultTreeIllustrationPointStochastEntity_StochastEntity' + ON 'GeneralResultFaultTreeIllustrationPointStochastEntity' ('StochastEntityId' ASC) +; +CREATE TRIGGER [TR_AfterDeleteGeneralResultFaultTreeIllustrationPointStochastEntity_RemoveStochastEntity] + AFTER DELETE + ON GeneralResultFaultTreeIllustrationPointStochastEntity + FOR EACH ROW +BEGIN + DELETE + FROM StochastEntity + WHERE OLD.StochastEntityId IS NOT NULL + AND StochastEntityId IS OLD.StochastEntityId; +END; +; + +CREATE INDEX 'IXFK_GeneralResultSubMechanismIllustrationPointStochastEntity_GeneralResultSubMechanismIllustrationPointEntity' + ON 'GeneralResultSubMechanismIllustrationPointStochastEntity' ('GeneralResultSubMechanismIllustrationPointEntityId' ASC) +; + +CREATE INDEX 'IXFK_GeneralResultSubMechanismIllustrationPointStochastEntity_StochastEntity' + ON 'GeneralResultSubMechanismIllustrationPointStochastEntity' ('StochastEntityId' ASC) +; +CREATE TRIGGER [TR_AfterDeleteGeneralResultSubMechanismIllustrationPointStochastEntity_RemoveStochastEntity] + AFTER DELETE + ON GeneralResultSubMechanismIllustrationPointStochastEntity + FOR EACH ROW +BEGIN + DELETE + FROM StochastEntity + WHERE OLD.StochastEntityId IS NOT NULL + AND StochastEntityId IS OLD.StochastEntityId; +END; +; + +CREATE INDEX 'IXFK_GrassCoverErosionInwardsDikeHeightOutputEntity_GeneralResultFaultTreeIllustrationPointEntity' + ON 'GrassCoverErosionInwardsDikeHeightOutputEntity' ('GeneralResultFaultTreeIllustrationPointEntityId' ASC) +; + +CREATE INDEX 'IXFK_GrassCoverErosionInwardsDikeHeightOutputEntity_GrassCoverErosionInwardsOutputEntity' + ON 'GrassCoverErosionInwardsDikeHeightOutputEntity' ('GrassCoverErosionInwardsOutputEntityId' ASC) +; +CREATE TRIGGER [TR_AfterDeleteGrassCoverErosionInwardsDikeHeightOutputEntity_RemoveGeneralResultFaultTreeIllustrationPointEntity] + AFTER DELETE + ON GrassCoverErosionInwardsDikeHeightOutputEntity + FOR EACH ROW +BEGIN + DELETE + FROM GeneralResultFaultTreeIllustrationPointEntity + WHERE OLD.GeneralResultFaultTreeIllustrationPointEntityId IS NOT NULL + AND GeneralResultFaultTreeIllustrationPointEntityId IS OLD.GeneralResultFaultTreeIllustrationPointEntityId; +END; +; + +CREATE INDEX 'IXFK_GrassCoverErosionInwardsOutputEntity_GeneralResultFaultTreeIllustrationPointEntity' + ON 'GrassCoverErosionInwardsOutputEntity' ('GeneralResultFaultTreeIllustrationPointEntityId' ASC) +; + +CREATE INDEX 'IXFK_GrassCoverErosionInwardsOutputEntity_GrassCoverErosionInwardsCalculationEntity' + ON 'GrassCoverErosionInwardsOutputEntity' ('GrassCoverErosionInwardsCalculationEntityId' ASC) +; +CREATE TRIGGER [TR_AfterDeleteGrassCoverErosionInwardsOutputEntity_RemoveGeneralResultFaultTreeIllustrationPointEntity] + AFTER DELETE + ON GrassCoverErosionInwardsOutputEntity + FOR EACH ROW +BEGIN + DELETE + FROM GeneralResultFaultTreeIllustrationPointEntity + WHERE OLD.GeneralResultFaultTreeIllustrationPointEntityId IS NOT NULL + AND GeneralResultFaultTreeIllustrationPointEntityId IS OLD.GeneralResultFaultTreeIllustrationPointEntityId; +END; +; + +CREATE INDEX 'IXFK_GrassCoverErosionInwardsOvertoppingRateOutputEntity_GeneralResultFaultTreeIllustrationPointEntity' + ON 'GrassCoverErosionInwardsOvertoppingRateOutputEntity' ('GeneralResultFaultTreeIllustrationPointEntityId' ASC) +; + +CREATE INDEX 'IXFK_GrassCoverErosionInwardsOvertoppingRateOutputEntity_GrassCoverErosionInwardsOutputEntity' + ON 'GrassCoverErosionInwardsOvertoppingRateOutputEntity' ('GrassCoverErosionInwardsOutputEntityId' ASC) +; +CREATE TRIGGER [TR_AfterDeleteGrassCoverErosionInwardsOvertoppingRateOutputEntity_RemoveGeneralResultFaultTreeIllustrationPointEntity] + AFTER DELETE + ON GrassCoverErosionInwardsOvertoppingRateOutputEntity + FOR EACH ROW +BEGIN + DELETE + FROM GeneralResultFaultTreeIllustrationPointEntity + WHERE OLD.GeneralResultFaultTreeIllustrationPointEntityId IS NOT NULL + AND GeneralResultFaultTreeIllustrationPointEntityId IS OLD.GeneralResultFaultTreeIllustrationPointEntityId; +END; +; + +CREATE INDEX 'IXFK_GrassCoverErosionInwardsSectionResultEntity_FailureMechanismSectionEntity' + ON 'GrassCoverErosionInwardsSectionResultEntity' ('FailureMechanismSectionEntityId' ASC) +; + +CREATE INDEX 'IXFK_GrassCoverErosionOutwardsSectionResultEntity_FailureMechanismSectionEntity' + ON 'GrassCoverErosionOutwardsSectionResultEntity' ('FailureMechanismSectionEntityId' ASC) +; + +CREATE INDEX 'IXFK_GrassCoverErosionOutwardsWaveConditionsCalculationEntity_CalculationGroupEntity' + ON 'GrassCoverErosionOutwardsWaveConditionsCalculationEntity' ('CalculationGroupEntityId' ASC) +; + +CREATE INDEX 'IXFK_GrassCoverErosionOutwardsWaveConditionsCalculationEntity_ForeshoreProfileEntity' + ON 'GrassCoverErosionOutwardsWaveConditionsCalculationEntity' ('ForeshoreProfileEntityId' ASC) +; + +CREATE INDEX 'IXFK_GrassCoverErosionOutwardsWaveConditionsCalculationEntity_HydraulicLocationEntity' + ON 'GrassCoverErosionOutwardsWaveConditionsCalculationEntity' ('HydraulicLocationEntityId' ASC) +; + +CREATE INDEX 'IXFK_GrassCoverErosionOutwardsWaveConditionsOutputEntity_GrassCoverErosionOutwardsWaveConditionsCalculationEntity' + ON 'GrassCoverErosionOutwardsWaveConditionsOutputEntity' ('GrassCoverErosionOutwardsWaveConditionsCalculationEntityId' ASC) +; + +CREATE INDEX 'IXFK_GrassCoverSlipOffInwardsSectionResultEntity_FailureMechanismSectionEntity' + ON 'GrassCoverSlipOffInwardsSectionResultEntity' ('FailureMechanismSectionEntityId' ASC) +; + +CREATE INDEX 'IXFK_GrassCoverSlipOffOutwardsSectionResultEntity_FailureMechanismSectionEntity' + ON 'GrassCoverSlipOffOutwardsSectionResultEntity' ('FailureMechanismSectionEntityId' ASC) +; + +CREATE INDEX 'IXFK_HeightStructure_FailureMechanismEntity' + ON 'HeightStructureEntity' ('FailureMechanismEntityId' ASC) +; + +CREATE INDEX 'IXFK_HeightStructuresCalculationEntity_CalculationGroupEntity' + ON 'HeightStructuresCalculationEntity' ('CalculationGroupEntityId' ASC) +; + +CREATE INDEX 'IXFK_HeightStructuresCalculationEntity_ForeshoreProfileEntity' + ON 'HeightStructuresCalculationEntity' ('ForeshoreProfileEntityId' ASC) +; + +CREATE INDEX 'IXFK_HeightStructuresCalculationEntity_HeightStructureEntity' + ON 'HeightStructuresCalculationEntity' ('HeightStructureEntityId' ASC) +; + +CREATE INDEX 'IXFK_HeightStructuresCalculationEntity_HydraulicLocationEntity' + ON 'HeightStructuresCalculationEntity' ('HydraulicLocationEntityId' ASC) +; + +CREATE INDEX 'IXFK_HeightStructuresFailureMechanismMetaEntity_FailureMechanismEntity' + ON 'HeightStructuresFailureMechanismMetaEntity' ('FailureMechanismEntityId' ASC) +; + +CREATE INDEX 'IXFK_HeightStructuresOutputEntity_HeightStructuresCalculationEntity' + ON 'HeightStructuresOutputEntity' ('HeightStructuresCalculationEntityId' ASC) +; +CREATE TRIGGER [TR_AfterDeleteHeightStructuresOutputEntity_RemoveGeneralResultFaultTreeIllustrationPointEntity] + AFTER DELETE + ON HeightStructuresOutputEntity + FOR EACH ROW +BEGIN + DELETE + FROM GeneralResultFaultTreeIllustrationPointEntity + WHERE OLD.GeneralResultFaultTreeIllustrationPointEntityId IS NOT NULL + AND GeneralResultFaultTreeIllustrationPointEntityId IS OLD.GeneralResultFaultTreeIllustrationPointEntityId; +END; +; + +CREATE INDEX 'IXFK_HeightStructuresSectionResultEntity_FailureMechanismSectionEntity' + ON 'HeightStructuresSectionResultEntity' ('FailureMechanismSectionEntityId' ASC) +; + +CREATE INDEX 'IXFK_HydraulicBoundaryDatabaseEntity_AssessmentSectionEntity' + ON 'HydraulicBoundaryDatabaseEntity' ('AssessmentSectionEntityId' ASC) +; + +CREATE INDEX 'IXFK_HydraulicLocationCalculationEntity_HydraulicLocationCalculationCollectionEntity' + ON 'HydraulicLocationCalculationEntity' ('HydraulicLocationCalculationCollectionEntityId' ASC) +; + +CREATE INDEX 'IXFK_HydraulicLocationCalculationEntity_HydraulicLocationEntity' + ON 'HydraulicLocationCalculationEntity' ('HydraulicLocationEntityId' ASC) +; + +CREATE INDEX 'IXFK_HydraulicLocationOutputEntity_GeneralResultSubMechanismIllustrationPointEntity' + ON 'HydraulicLocationOutputEntity' ('GeneralResultSubMechanismIllustrationPointEntityId' ASC) +; + +CREATE INDEX 'IXFK_HydraulicLocationOutputEntity_HydraulicLocationCalculationEntity' + ON 'HydraulicLocationOutputEntity' ('HydraulicLocationCalculationEntityId' ASC) +; +CREATE TRIGGER [TR_AfterDeleteHydraulicLocationOutputEntity_RemoveGeneralResultSubMechanismIllustrationPointEntity] + AFTER DELETE + ON HydraulicLocationOutputEntity + FOR EACH ROW +BEGIN + DELETE + FROM GeneralResultSubMechanismIllustrationPointEntity + WHERE OLD.GeneralResultSubMechanismIllustrationPointEntityId IS NOT NULL + AND GeneralResultSubMechanismIllustrationPointEntityId IS OLD.GeneralResultSubMechanismIllustrationPointEntityId; +END; +; + +CREATE INDEX 'IXFK_IllustrationPointResultEntity_SubMechanismIllustrationPointEntity' + ON 'IllustrationPointResultEntity' ('SubMechanismIllustrationPointEntityId' ASC) +; + +CREATE INDEX 'IXFK_MacroStabilityInwardsCalculationEntity_CalculationGroupEntity' + ON 'MacroStabilityInwardsCalculationEntity' ('CalculationGroupEntityId' ASC) +; + +CREATE INDEX 'IXFK_MacroStabilityInwardsCalculationEntity_HydraulicLocationEntity' + ON 'MacroStabilityInwardsCalculationEntity' ('HydraulicLocationEntityId' ASC) +; + +CREATE INDEX 'IXFK_MacroStabilityInwardsCalculationEntity_MacroStabilityInwardsStochasticSoilProfileEntity' + ON 'MacroStabilityInwardsCalculationEntity' ('MacroStabilityInwardsStochasticSoilProfileEntityId' ASC) +; + +CREATE INDEX 'IXFK_MacroStabilityInwardsCalculationOutput_MacroStabilityInwardsCalculationEntity' + ON 'MacroStabilityInwardsCalculationOutputEntity' ('MacroStabilityInwardsCalculationEntityId' ASC) +; + +CREATE INDEX 'IXFK_MacroStabilityCharacteristicPointEntity_SurfaceLineEntity' + ON 'MacroStabilityInwardsCharacteristicPointEntity' ('SurfaceLineEntityId' ASC) +; + +CREATE INDEX 'IXFK_MacroStabilityInwardsFailureMechanismMetaEntity_FailureMechanismEntity' + ON 'MacroStabilityInwardsFailureMechanismMetaEntity' ('FailureMechanismEntityId' ASC) +; + +CREATE INDEX 'IXFK_MacroStabilityInwardsSectionResultEntity_FailureMechanismSectionEntity' + ON 'MacroStabilityInwardsSectionResultEntity' ('FailureMechanismSectionEntityId' ASC) +; + +CREATE INDEX 'IXFK_MacroStabilityInwardsSoilLayerOneDEntity_MacroStabilityInwardsSoilProfileOneDEntity' + ON 'MacroStabilityInwardsSoilLayerOneDEntity' ('MacroStabilityInwardsSoilProfileOneDEntityId' ASC) +; + +CREATE TRIGGER [TR_AfterDeleteMacroStabilityInwardsSoilProfileTwoDEntity_MacroStabilityInwardsSoilLayerTwoDEntity] + AFTER DELETE + ON MacroStabilityInwardsSoilProfileTwoDEntity + FOR EACH ROW +BEGIN + DELETE + FROM MacroStabilityInwardsSoilLayerTwoDEntity + WHERE OLD.MacroStabilityInwardsSoilLayerTwoDEntity IS NOT NULL + AND MacroStabilityInwardsSoilLayerTwoDEntity IS OLD.MacroStabilityInwardsSoilLayerTwoDEntity; +END; +; + +CREATE INDEX 'IXFK_MacroStabilityInwardsStochasticSoilProfileEntity_StochasticSoilModelEntity' + ON 'MacroStabilityInwardsStochasticSoilProfileEntity' ('StochasticSoilModelEntityId' ASC) +; +CREATE TRIGGER [TR_BeforeInsertMacroStabilityInwardsStochasticSoilProfileEntity_MustHaveOneDOrTwoD] + BEFORE INSERT + ON MacroStabilityInwardsStochasticSoilProfileEntity + FOR EACH ROW +BEGIN + SELECT + CASE + WHEN + ( + NEW.MacroStabilityInwardsSoilProfileOneDEntityId IS NULL AND NEW.MacroStabilityInwardsSoilProfileTwoDEntityId IS NULL + ) OR ( + NEW.MacroStabilityInwardsSoilProfileOneDEntityId IS NOT NULL AND NEW.MacroStabilityInwardsSoilProfileTwoDEntityId IS NOT NULL + ) + THEN RAISE(FAIL, 'Either SoilProfile1D or SoilProfile2D must be set.') + END; +END; +; + +CREATE TRIGGER [TR_BeforeUpdateMacroStabilityInwardsStochasticSoilProfileEntity_MustHaveOneDOrTwoD] + BEFORE UPDATE + ON MacroStabilityInwardsStochasticSoilProfileEntity + FOR EACH ROW +BEGIN + SELECT + CASE + WHEN + ( + NEW.MacroStabilityInwardsSoilProfileOneDEntityId IS NULL AND NEW.MacroStabilityInwardsSoilProfileTwoDEntityId IS NULL + ) OR ( + NEW.MacroStabilityInwardsSoilProfileOneDEntityId IS NOT NULL AND NEW.MacroStabilityInwardsSoilProfileTwoDEntityId IS NOT NULL + ) + THEN RAISE(FAIL, 'Either SoilProfile1D or SoilProfile2D must be set.') + END; +END; +; + +CREATE INDEX 'IXFK_MacroStabilityOutwardsFailureMechanismMetaEntity_FailureMechanismEntity' + ON 'MacroStabilityOutwardsFailureMechanismMetaEntity' ('FailureMechanismEntityId' ASC) +; + +CREATE INDEX 'IXFK_MacroStabilityOutwardsSectionResultEntity_FailureMechanismSectionEntity' + ON 'MacroStabilityOutwardsSectionResultEntity' ('FailureMechanismSectionEntityId' ASC) +; + +CREATE INDEX 'IXFK_MicrostabilitySectionResultEntity_FailureMechanismSectionEntity' + ON 'MicrostabilitySectionResultEntity' ('FailureMechanismSectionEntityId' ASC) +; + +CREATE INDEX 'IXFK_PipingFailureMechanismMetaEntity_FailureMechanismEntity' + ON 'PipingFailureMechanismMetaEntity' ('FailureMechanismEntityId' ASC) +; + +CREATE INDEX 'IXFK_PipingSectionResultEntity_FailureMechanismSectionEntity' + ON 'PipingSectionResultEntity' ('FailureMechanismSectionEntityId' ASC) +; + +CREATE INDEX 'IXFK_PipingStructureFailureMechanismMetaEntity_FailureMechanismEntity' + ON 'PipingStructureFailureMechanismMetaEntity' ('FailureMechanismEntityId' ASC) +; + +CREATE INDEX 'IXFK_PipingStructureSectionResultEntity_FailureMechanismSectionEntity' + ON 'PipingStructureSectionResultEntity' ('FailureMechanismSectionEntityId' ASC) +; + +CREATE INDEX 'IXFK_ProbabilisticPipingCalculationEntity_CalculationGroupEntity' + ON 'ProbabilisticPipingCalculationEntity' ('CalculationGroupEntityId' ASC) +; + +CREATE INDEX 'IXFK_ProbabilisticPipingCalculationEntity_HydraulicLocationEntity' + ON 'ProbabilisticPipingCalculationEntity' ('HydraulicLocationEntityId' ASC) +; + +CREATE INDEX 'IXFK_ProbabilisticPipingCalculationEntity_PipingStochasticSoilProfileEntity' + ON 'ProbabilisticPipingCalculationEntity' ('PipingStochasticSoilProfileEntityId' ASC) +; + +CREATE INDEX 'IXFK_ProbabilisticPipingCalculationEntity_SurfaceLineEntity' + ON 'ProbabilisticPipingCalculationEntity' ('SurfaceLineEntityId' ASC) +; + +CREATE INDEX 'IXFK_ProbabilisticPipingCalculationOutputEntity_ProbabilisticPipingCalculationEntity' + ON 'ProbabilisticPipingCalculationOutputEntity' ('ProbabilisticPipingCalculationEntityId' ASC) +; + +CREATE INDEX 'IXFK_ProbabilisticPipingCalculationOutputEntity_Profile_GeneralResultFaultTreeIllustrationPointEntity' + ON 'ProbabilisticPipingCalculationOutputEntity' ('ProfileSpecificGeneralResultFaultTreeIllustrationPointEntityId' ASC) +; + +CREATE INDEX 'IXFK_ProbabilisticPipingCalculationOutputEntity_Profile_GeneralResultSubMechanismIllustrationPointEntity' + ON 'ProbabilisticPipingCalculationOutputEntity' ('ProfileSpecificGeneralResultSubMechanismIllustrationPointEntityId' ASC) +; + +CREATE INDEX 'IXFK_ProbabilisticPipingCalculationOutputEntity_Section_GeneralResultFaultTreeIllustrationPointEntity' + ON 'ProbabilisticPipingCalculationOutputEntity' ('ProfileSpecificGeneralResultFaultTreeIllustrationPointEntityId' ASC) +; + +CREATE INDEX 'IXFK_ProbabilisticPipingCalculationOutputEntity_Section_GeneralResultSubMechanismIllustrationPointEntity' + ON 'ProbabilisticPipingCalculationOutputEntity' ('SectionSpecificGeneralResultSubMechanismIllustrationPointEntityId' ASC) +; + +CREATE INDEX 'IXFK_SemiProbabilisticPipingCalculationOutputEntity_SemiProbabilisticPipingCalculationEntity' + ON 'SemiProbabilisticPipingCalculationOutputEntity' ('SemiProbabilisticPipingCalculationEntityId' ASC) +; + +CREATE INDEX 'IXFK_StabilityPointStructureEntity_FailureMechanismEntity' + ON 'StabilityPointStructureEntity' ('FailureMechanismEntityId' ASC) +; + +CREATE INDEX 'IXFK_StabilityPointStructuresCalculationEntity_CalculationGroupEntity' + ON 'StabilityPointStructuresCalculationEntity' ('CalculationGroupEntityId' ASC) +; + +CREATE INDEX 'IXFK_StabilityPointStructuresCalculationEntity_ForeshoreProfileEntity' + ON 'StabilityPointStructuresCalculationEntity' ('ForeshoreProfileEntityId' ASC) +; + +CREATE INDEX 'IXFK_StabilityPointStructuresCalculationEntity_HydraulicLocationEntity' + ON 'StabilityPointStructuresCalculationEntity' ('HydraulicLocationEntityId' ASC) +; + +CREATE INDEX 'IXFK_StabilityPointStructuresCalculationEntity_StabilityPointStructureEntity' + ON 'StabilityPointStructuresCalculationEntity' ('StabilityPointStructureEntityId' ASC) +; + +CREATE INDEX 'IXFK_StrengthStabilityPointConstructionFailureMechanismMetaEntity_FailureMechanismEntity' + ON 'StabilityPointStructuresFailureMechanismMetaEntity' ('FailureMechanismEntityId' ASC) +; + +CREATE INDEX 'IXFK_StabilityPointStructuresOutputEntity_StabilityPointStructuresCalculationEntity' + ON 'StabilityPointStructuresOutputEntity' ('StabilityPointStructuresCalculationEntityId' ASC) +; +CREATE TRIGGER [TR_AfterDeleteStabilityPointStructuresOutputEntity_RemoveGeneralResultFaultTreeIllustrationPointEntity] + AFTER DELETE + ON StabilityPointStructuresOutputEntity + FOR EACH ROW +BEGIN + DELETE + FROM GeneralResultFaultTreeIllustrationPointEntity + WHERE OLD.GeneralResultFaultTreeIllustrationPointEntityId IS NOT NULL + AND GeneralResultFaultTreeIllustrationPointEntityId IS OLD.GeneralResultFaultTreeIllustrationPointEntityId; +END; +; + +CREATE INDEX 'IXFK_StabilityPointStructuresSectionResultEntity_FailureMechanismSectionEntity' + ON 'StabilityPointStructuresSectionResultEntity' ('FailureMechanismSectionEntityId' ASC) +; + +CREATE INDEX 'IXFK_StabilityStoneCoverFailureMechanismMetaEntity_FailureMechanismEntity' + ON 'StabilityStoneCoverFailureMechanismMetaEntity' ('FailureMechanismEntityId' ASC) +; + +CREATE INDEX 'IXFK_StabilityStoneCoverSectionResultEntity_FailureMechanismSectionEntity' + ON 'StabilityStoneCoverSectionResultEntity' ('FailureMechanismSectionEntityId' ASC) +; + +CREATE INDEX 'IXFK_StabilityStoneCoverWaveConditionsCalculationEntity_CalculationGroupEntity' + ON 'StabilityStoneCoverWaveConditionsCalculationEntity' ('CalculationGroupEntityId' ASC) +; + +CREATE INDEX 'IXFK_StabilityStoneCoverWaveConditionsCalculationEntity_ForeshoreProfileEntity' + ON 'StabilityStoneCoverWaveConditionsCalculationEntity' ('ForeshoreProfileEntityId' ASC) +; + +CREATE INDEX 'IXFK_StabilityStoneCoverWaveConditionsCalculationEntity_HydraulicLocationEntity' + ON 'StabilityStoneCoverWaveConditionsCalculationEntity' ('HydraulicLocationEntityId' ASC) +; + +CREATE INDEX 'IXFK_StabilityStoneCoverWaveConditionsOutputEntity_StabilityStoneCoverWaveConditionsCalculationEntity' + ON 'StabilityStoneCoverWaveConditionsOutputEntity' ('StabilityStoneCoverWaveConditionsCalculationEntityId' ASC) +; + +CREATE INDEX 'IXFK_StrengthStabilityLengthwiseConstructionSectionResultEntity_FailureMechanismSectionEntity' + ON 'StrengthStabilityLengthwiseConstructionSectionResultEntity' ('FailureMechanismSectionEntityId' ASC) +; + +CREATE INDEX 'IXFK_SubMechanismIllustrationPointStochast_SubMechanismIllustrationPointEntity' + ON 'SubMechanismIllustrationPointStochastEntity' ('SubMechanismIllustrationPointEntityId' ASC) +; + +CREATE INDEX 'IXFK_TechnicalInnovationSectionResultEntity_FailureMechanismSectionEntity' + ON 'TechnicalInnovationSectionResultEntity' ('FailureMechanismSectionEntityId' ASC) +; + +CREATE INDEX 'IXFK_TopLevelFaultTreeIllustrationPointEntity_FaultTreeIllustrationPointEntity' + ON 'TopLevelFaultTreeIllustrationPointEntity' ('FaultTreeIllustrationPointEntityId' ASC) +; + +CREATE INDEX 'IXFK_TopLevelFaultTreeIllustrationPointEntity_GeneralResultFaultTreeIllustrationPointEntity' + ON 'TopLevelFaultTreeIllustrationPointEntity' ('GeneralResultFaultTreeIllustrationPointEntityId' ASC) +; +CREATE TRIGGER [TR_AfterDeleteTopLevelFaultTreeIllustrationPointEntity_RemoveFaultTreeIllustrationPointEntity] + AFTER DELETE + ON TopLevelFaultTreeIllustrationPointEntity + FOR EACH ROW +BEGIN + DELETE + FROM FaultTreeIllustrationPointEntity + WHERE OLD.FaultTreeIllustrationPointEntityId IS NOT NULL + AND FaultTreeIllustrationPointEntityId IS OLD.FaultTreeIllustrationPointEntityId; +END; +; + +CREATE INDEX 'IXFK_TopLevelSubMechanismIllustrationPointEntity_GeneralResultSubMechanismIllustrationPointEntity' + ON 'TopLevelSubMechanismIllustrationPointEntity' ('GeneralResultSubMechanismIllustrationPointEntityId' ASC) +; + +CREATE INDEX 'IXFK_TopLevelSubMechanismIllustrationPointEntity_SubMechanismIllustrationPointEntity' + ON 'TopLevelSubMechanismIllustrationPointEntity' ('SubMechanismIllustrationPointEntityId' ASC) +; +CREATE TRIGGER [TR_AfterDeleteTopLevelSubMechanismIllustrationPointEntity_RemoveSubMechanismIllustrationPointEntity] + AFTER DELETE + ON TopLevelSubMechanismIllustrationPointEntity + FOR EACH ROW +BEGIN + DELETE + FROM SubMechanismIllustrationPointEntity + WHERE OLD.SubMechanismIllustrationPointEntityId IS NOT NULL + AND SubMechanismIllustrationPointEntityId IS OLD.SubMechanismIllustrationPointEntityId; +END; +; + +CREATE INDEX 'IXFK_WaterPressureAsphaltCoverSectionResultEntity_FailureMechanismSectionEntity' + ON 'WaterPressureAsphaltCoverSectionResultEntity' ('FailureMechanismSectionEntityId' ASC) +; + +CREATE INDEX 'IXFK_WaveImpactAsphaltCoverSectionResultEntity_FailureMechanismSectionEntity' + ON 'WaveImpactAsphaltCoverSectionResultEntity' ('FailureMechanismSectionEntityId' ASC) +; + +CREATE INDEX 'IXFK_WaveImpactAsphaltCoverWaveConditionsCalculationEntity_CalculationGroupEntity' + ON 'WaveImpactAsphaltCoverWaveConditionsCalculationEntity' ('CalculationGroupEntityId' ASC) +; + +CREATE INDEX 'IXFK_WaveImpactAsphaltCoverWaveConditionsCalculationEntity_ForeshoreProfileEntity' + ON 'WaveImpactAsphaltCoverWaveConditionsCalculationEntity' ('ForeshoreProfileEntityId' ASC) +; + +CREATE INDEX 'IXFK_WaveImpactAsphaltCoverWaveConditionsCalculationEntity_HydraulicLocationEntity' + ON 'WaveImpactAsphaltCoverWaveConditionsCalculationEntity' ('HydraulicLocationEntityId' ASC) +; + +CREATE INDEX 'IXFK_WaveImpactAsphaltCoverWaveConditionsOutputEntity_WaveImpactAsphaltCoverWaveConditionsCalculationEntity' + ON 'WaveImpactAsphaltCoverWaveConditionsOutputEntity' ('WaveImpactAsphaltCoverWaveConditionsCalculationEntityId' ASC) +; Fisheye: Tag 22a1505cd4329747b28df26d6042e997eca20882 refers to a dead (removed) revision in file `Riskeer/Migration/src/Riskeer.Migration.Core/EmbeddedResources/Migration_19.1_20.1.sql'. Fisheye: No comparison available. Pass `N' to diff? Index: Riskeer/Migration/src/Riskeer.Migration.Core/EmbeddedResources/Migration_19.1_21.1.sql =================================================================== diff -u --- Riskeer/Migration/src/Riskeer.Migration.Core/EmbeddedResources/Migration_19.1_21.1.sql (revision 0) +++ Riskeer/Migration/src/Riskeer.Migration.Core/EmbeddedResources/Migration_19.1_21.1.sql (revision 22a1505cd4329747b28df26d6042e997eca20882) @@ -0,0 +1,974 @@ +/* +Migration script for migrating Riskeer databases. +SourceProject version: 19.1 +TargetProject version: 21.1 +*/ + +PRAGMA foreign_keys = OFF; + +ATTACH DATABASE "{0}" AS SOURCEPROJECT; + +INSERT INTO AssessmentSectionEntity SELECT * FROM [SOURCEPROJECT].AssessmentSectionEntity; +INSERT INTO BackgroundDataEntity SELECT * FROM [SOURCEPROJECT].BackgroundDataEntity; +INSERT INTO BackgroundDataMetaEntity SELECT * FROM [SOURCEPROJECT].BackgroundDataMetaEntity; +INSERT INTO CalculationGroupEntity SELECT * FROM [SOURCEPROJECT].CalculationGroupEntity; +INSERT INTO ClosingStructureEntity SELECT * FROM [SOURCEPROJECT].ClosingStructureEntity; +INSERT INTO ClosingStructuresCalculationEntity( + [ClosingStructuresCalculationEntityId], + [CalculationGroupEntityId], + [ForeshoreProfileEntityId], + [HydraulicLocationEntityId], + [ClosingStructureEntityId], + [Order], + [Name], + [Comments], + [UseBreakWater], + [BreakWaterType], + [BreakWaterHeight], + [UseForeshore], + [Orientation], + [StructureNormalOrientation], + [StorageStructureAreaMean], + [StorageStructureAreaCoefficientOfVariation], + [AllowedLevelIncreaseStorageMean], + [AllowedLevelIncreaseStorageStandardDeviation], + [WidthFlowAperturesMean], + [WidthFlowAperturesStandardDeviation], + [LevelCrestStructureNotClosingMean], + [LevelCrestStructureNotClosingStandardDeviation], + [InsideWaterLevelMean], + [InsideWaterLevelStandardDeviation], + [ThresholdHeightOpenWeirMean], + [ThresholdHeightOpenWeirStandardDeviation], + [AreaFlowAperturesMean], + [AreaFlowAperturesStandardDeviation], + [CriticalOvertoppingDischargeMean], + [CriticalOvertoppingDischargeCoefficientOfVariation], + [FlowWidthAtBottomProtectionMean], + [FlowWidthAtBottomProtectionStandardDeviation], + [ProbabilityOpenStructureBeforeFlooding], + [FailureProbabilityOpenStructure], + [IdenticalApertures], + [FailureProbabilityReparation], + [InflowModelType], + [FailureProbabilityStructureWithErosion], + [DeviationWaveDirection], + [DrainCoefficientMean], + [DrainCoefficientStandardDeviation], + [ModelFactorSuperCriticalFlowMean], + [StormDurationMean], + [FactorStormDurationOpenStructure], + [ShouldIllustrationPointsBeCalculated], + [RelevantForScenario], + [ScenarioContribution]) +SELECT + [ClosingStructuresCalculationEntityId], + [CalculationGroupEntityId], + [ForeshoreProfileEntityId], + [HydraulicLocationEntityId], + [ClosingStructureEntityId], + [Order], + [Name], + [Comments], + [UseBreakWater], + [BreakWaterType], + [BreakWaterHeight], + [UseForeshore], + [Orientation], + [StructureNormalOrientation], + [StorageStructureAreaMean], + [StorageStructureAreaCoefficientOfVariation], + [AllowedLevelIncreaseStorageMean], + [AllowedLevelIncreaseStorageStandardDeviation], + [WidthFlowAperturesMean], + [WidthFlowAperturesStandardDeviation], + [LevelCrestStructureNotClosingMean], + [LevelCrestStructureNotClosingStandardDeviation], + [InsideWaterLevelMean], + [InsideWaterLevelStandardDeviation], + [ThresholdHeightOpenWeirMean], + [ThresholdHeightOpenWeirStandardDeviation], + [AreaFlowAperturesMean], + [AreaFlowAperturesStandardDeviation], + [CriticalOvertoppingDischargeMean], + [CriticalOvertoppingDischargeCoefficientOfVariation], + [FlowWidthAtBottomProtectionMean], + [FlowWidthAtBottomProtectionStandardDeviation], + [ProbabilityOpenStructureBeforeFlooding], + [FailureProbabilityOpenStructure], + [IdenticalApertures], + [FailureProbabilityReparation], + [InflowModelType], + [FailureProbabilityStructureWithErosion], + [DeviationWaveDirection], + [DrainCoefficientMean], + 0.2, + [ModelFactorSuperCriticalFlowMean], + [StormDurationMean], + [FactorStormDurationOpenStructure], + [ShouldIllustrationPointsBeCalculated], + CASE + WHEN IsLinkedToSectionResult IS NOT NULL + THEN 1 + ELSE 0 + END, + CASE + WHEN IsLinkedToSectionResult IS NOT NULL + THEN 1 + ELSE 0 + END +FROM [SOURCEPROJECT].ClosingStructuresCalculationEntity +LEFT JOIN( + SELECT + ClosingStructuresCalculationEntityId, + CASE + WHEN ClosingStructuresSectionResultEntityId IS NOT NULL + THEN 1 + ELSE 0 + END AS IsLinkedToSectionResult + FROM [SOURCEPROJECT].ClosingStructuresSectionResultEntity) +USING(ClosingStructuresCalculationEntityId); +INSERT INTO ClosingStructuresFailureMechanismMetaEntity SELECT * FROM [SOURCEPROJECT].ClosingStructuresFailureMechanismMetaEntity; +INSERT INTO ClosingStructuresSectionResultEntity ( + [ClosingStructuresSectionResultEntityId], + [FailureMechanismSectionEntityId], + [SimpleAssessmentResult], + [DetailedAssessmentResult], + [TailorMadeAssessmentResult], + [TailorMadeAssessmentProbability], + [UseManualAssembly], + [ManualAssemblyProbability]) +SELECT + [ClosingStructuresSectionResultEntityId], + [FailureMechanismSectionEntityId], + [SimpleAssessmentResult], + [DetailedAssessmentResult], + [TailorMadeAssessmentResult], + [TailorMadeAssessmentProbability], + [UseManualAssembly], + [ManualAssemblyProbability] +FROM [SOURCEPROJECT].ClosingStructuresSectionResultEntity; +INSERT INTO DikeProfileEntity SELECT * FROM [SOURCEPROJECT].DikeProfileEntity; +INSERT INTO DuneErosionFailureMechanismMetaEntity SELECT * FROM [SOURCEPROJECT].DuneErosionFailureMechanismMetaEntity; +INSERT INTO DuneErosionSectionResultEntity SELECT * FROM [SOURCEPROJECT].DuneErosionSectionResultEntity; +INSERT INTO DuneLocationCalculationCollectionEntity SELECT * FROM [SOURCEPROJECT].DuneLocationCalculationCollectionEntity; +INSERT INTO DuneLocationCalculationEntity SELECT * FROM [SOURCEPROJECT].DuneLocationCalculationEntity; +INSERT INTO DuneLocationEntity SELECT * FROM [SOURCEPROJECT].DuneLocationEntity; +INSERT INTO FailureMechanismEntity SELECT * FROM [SOURCEPROJECT].FailureMechanismEntity; +INSERT INTO FailureMechanismSectionEntity SELECT * FROM [SOURCEPROJECT].FailureMechanismSectionEntity; +INSERT INTO ForeshoreProfileEntity SELECT * FROM [SOURCEPROJECT].ForeshoreProfileEntity; +INSERT INTO GrassCoverErosionInwardsCalculationEntity( + [GrassCoverErosionInwardsCalculationEntityId], + [CalculationGroupEntityId], + [HydraulicLocationEntityId], + [DikeProfileEntityId], + [Order], + [Name], + [Comments], + [Orientation], + [CriticalFlowRateMean], + [CriticalFlowRateStandardDeviation], + [UseForeshore], + [DikeHeightCalculationType], + [DikeHeight], + [UseBreakWater], + [BreakWaterType], + [BreakWaterHeight], + [OvertoppingRateCalculationType], + [ShouldDikeHeightIllustrationPointsBeCalculated], + [ShouldOvertoppingRateIllustrationPointsBeCalculated], + [ShouldOvertoppingOutputIllustrationPointsBeCalculated], + [RelevantForScenario], + [ScenarioContribution]) +SELECT + [GrassCoverErosionInwardsCalculationEntityId], + [CalculationGroupEntityId], + [HydraulicLocationEntityId], + [DikeProfileEntityId], + [Order], + [Name], + [Comments], + [Orientation], + [CriticalFlowRateMean], + [CriticalFlowRateStandardDeviation], + [UseForeshore], + [DikeHeightCalculationType], + [DikeHeight], + [UseBreakWater], + [BreakWaterType], + [BreakWaterHeight], + [OvertoppingRateCalculationType], + [ShouldDikeHeightIllustrationPointsBeCalculated], + [ShouldOvertoppingRateIllustrationPointsBeCalculated], + [ShouldOvertoppingOutputIllustrationPointsBeCalculated], + CASE + WHEN IsLinkedToSectionResult IS NOT NULL + THEN 1 + ELSE 0 + END, + CASE + WHEN IsLinkedToSectionResult IS NOT NULL + THEN 1 + ELSE 0 + END +FROM [SOURCEPROJECT].GrassCoverErosionInwardsCalculationEntity +LEFT JOIN( + SELECT + GrassCoverErosionInwardsCalculationEntityId, + CASE + WHEN GrassCoverErosionInwardsSectionResultEntityId IS NOT NULL + THEN 1 + ELSE 0 + END AS IsLinkedToSectionResult + FROM [SOURCEPROJECT].GrassCoverErosionInwardsSectionResultEntity) +USING(GrassCoverErosionInwardsCalculationEntityId); +INSERT INTO GrassCoverErosionInwardsFailureMechanismMetaEntity SELECT * FROM [SOURCEPROJECT].GrassCoverErosionInwardsFailureMechanismMetaEntity; +INSERT INTO GrassCoverErosionInwardsSectionResultEntity ( + [GrassCoverErosionInwardsSectionResultEntityId], + [FailureMechanismSectionEntityId], + [SimpleAssessmentResult], + [DetailedAssessmentResult], + [TailorMadeAssessmentResult], + [TailorMadeAssessmentProbability], + [UseManualAssembly], + [ManualAssemblyProbability]) +SELECT + [GrassCoverErosionInwardsSectionResultEntityId], + [FailureMechanismSectionEntityId], + [SimpleAssessmentResult], + [DetailedAssessmentResult], + [TailorMadeAssessmentResult], + [TailorMadeAssessmentProbability], + [UseManualAssembly], + [ManualAssemblyProbability] +FROM [SOURCEPROJECT].GrassCoverErosionInwardsSectionResultEntity; +INSERT INTO GrassCoverErosionOutwardsFailureMechanismMetaEntity SELECT * FROM [SOURCEPROJECT].GrassCoverErosionOutwardsFailureMechanismMetaEntity; +INSERT INTO GrassCoverErosionOutwardsSectionResultEntity SELECT * FROM [SOURCEPROJECT].GrassCoverErosionOutwardsSectionResultEntity; +INSERT INTO GrassCoverErosionOutwardsWaveConditionsCalculationEntity SELECT * FROM [SOURCEPROJECT].GrassCoverErosionOutwardsWaveConditionsCalculationEntity; +INSERT INTO GrassCoverSlipOffInwardsSectionResultEntity SELECT * FROM [SOURCEPROJECT].GrassCoverSlipOffInwardsSectionResultEntity; +INSERT INTO GrassCoverSlipOffOutwardsSectionResultEntity SELECT * FROM [SOURCEPROJECT].GrassCoverSlipOffOutwardsSectionResultEntity; +INSERT INTO HeightStructureEntity SELECT * FROM [SOURCEPROJECT].HeightStructureEntity; +INSERT INTO HeightStructuresCalculationEntity ( + [HeightStructuresCalculationEntityId], + [CalculationGroupEntityId], + [HydraulicLocationEntityId], + [HeightStructureEntityId], + [ForeshoreProfileEntityId], + [Order], + [Name], + [Comments], + [ModelFactorSuperCriticalFlowMean], + [StructureNormalOrientation], + [AllowedLevelIncreaseStorageMean], + [AllowedLevelIncreaseStorageStandardDeviation], + [StorageStructureAreaMean], + [StorageStructureAreaCoefficientOfVariation], + [FlowWidthAtBottomProtectionMean], + [FlowWidthAtBottomProtectionStandardDeviation], + [CriticalOvertoppingDischargeMean], + [CriticalOvertoppingDischargeCoefficientOfVariation], + [FailureProbabilityStructureWithErosion], + [WidthFlowAperturesMean], + [WidthFlowAperturesStandardDeviation], + [StormDurationMean], + [LevelCrestStructureMean], + [LevelCrestStructureStandardDeviation], + [DeviationWaveDirection], + [UseBreakWater], + [UseForeshore], + [BreakWaterType], + [BreakWaterHeight], + [ShouldIllustrationPointsBeCalculated], + [RelevantForScenario], + [ScenarioContribution]) +SELECT + [HeightStructuresCalculationEntityId], + [CalculationGroupEntityId], + [HydraulicLocationEntityId], + [HeightStructureEntityId], + [ForeshoreProfileEntityId], + [Order], + [Name], + [Comments], + [ModelFactorSuperCriticalFlowMean], + [StructureNormalOrientation], + [AllowedLevelIncreaseStorageMean], + [AllowedLevelIncreaseStorageStandardDeviation], + [StorageStructureAreaMean], + [StorageStructureAreaCoefficientOfVariation], + [FlowWidthAtBottomProtectionMean], + [FlowWidthAtBottomProtectionStandardDeviation], + [CriticalOvertoppingDischargeMean], + [CriticalOvertoppingDischargeCoefficientOfVariation], + [FailureProbabilityStructureWithErosion], + [WidthFlowAperturesMean], + [WidthFlowAperturesStandardDeviation], + [StormDurationMean], + [LevelCrestStructureMean], + [LevelCrestStructureStandardDeviation], + [DeviationWaveDirection], + [UseBreakWater], + [UseForeshore], + [BreakWaterType], + [BreakWaterHeight], + [ShouldIllustrationPointsBeCalculated], + CASE + WHEN IsLinkedToSectionResult IS NOT NULL + THEN 1 + ELSE 0 + END, + CASE + WHEN IsLinkedToSectionResult IS NOT NULL + THEN 1 + ELSE 0 + END +FROM [SOURCEPROJECT].HeightStructuresCalculationEntity +LEFT JOIN( + SELECT + HeightStructuresCalculationEntityId, + CASE + WHEN HeightStructuresSectionResultEntityId IS NOT NULL + THEN 1 + ELSE 0 + END AS IsLinkedToSectionResult + FROM [SOURCEPROJECT].HeightStructuresSectionResultEntity) +USING(HeightStructuresCalculationEntityId); +INSERT INTO HeightStructuresFailureMechanismMetaEntity SELECT * FROM [SOURCEPROJECT].HeightStructuresFailureMechanismMetaEntity; +INSERT INTO HeightStructuresSectionResultEntity ( + [HeightStructuresSectionResultEntityId], + [FailureMechanismSectionEntityId], + [SimpleAssessmentResult], + [DetailedAssessmentResult], + [TailorMadeAssessmentResult], + [TailorMadeAssessmentProbability], + [UseManualAssembly], + [ManualAssemblyProbability]) +SELECT + [HeightStructuresSectionResultEntityId], + [FailureMechanismSectionEntityId], + [SimpleAssessmentResult], + [DetailedAssessmentResult], + [TailorMadeAssessmentResult], + [TailorMadeAssessmentProbability], + [UseManualAssembly], + [ManualAssemblyProbability] +FROM [SOURCEPROJECT].HeightStructuresSectionResultEntity; +INSERT INTO HydraulicBoundaryDatabaseEntity SELECT * FROM [SOURCEPROJECT].HydraulicBoundaryDatabaseEntity; +INSERT INTO HydraulicLocationCalculationCollectionEntity SELECT * FROM [SOURCEPROJECT].HydraulicLocationCalculationCollectionEntity; +INSERT INTO HydraulicLocationCalculationEntity SELECT * FROM [SOURCEPROJECT].HydraulicLocationCalculationEntity; +INSERT INTO HydraulicLocationEntity SELECT * FROM [SOURCEPROJECT].HydraulicLocationEntity; +INSERT INTO MacroStabilityInwardsCalculationEntity ( + [MacroStabilityInwardsCalculationEntityId], + [CalculationGroupEntityId], + [SurfaceLineEntityId], + [MacroStabilityInwardsStochasticSoilProfileEntityId], + [HydraulicLocationEntityId], + [Order], + [Name], + [Comment], + [RelevantForScenario], + [ScenarioContribution], + [AssessmentLevel], + [UseAssessmentLevelManualInput], + [SlipPlaneMinimumDepth], + [SlipPlaneMinimumLength], + [MaximumSliceWidth], + [MoveGrid], + [GridDeterminationType], + [TangentLineDeterminationType], + [TangentLineZTop], + [TangentLineZBottom], + [TangentLineNumber], + [LeftGridXLeft], + [LeftGridXRight], + [LeftGridNrOfHorizontalPoints], + [LeftGridZTop], + [LeftGridZBottom], + [LeftGridNrOfVerticalPoints], + [RightGridXLeft], + [RightGridXRight], + [RightGridNrOfHorizontalPoints], + [RightGridZTop], + [RightGridZBottom], + [RightGridNrOfVerticalPoints], + [DikeSoilScenario], + [WaterLevelRiverAverage], + [DrainageConstructionPresent], + [DrainageConstructionCoordinateX], + [DrainageConstructionCoordinateZ], + [MinimumLevelPhreaticLineAtDikeTopRiver], + [MinimumLevelPhreaticLineAtDikeTopPolder], + [AdjustPhreaticLine3And4ForUplift], + [LeakageLengthOutwardsPhreaticLine3], + [LeakageLengthInwardsPhreaticLine3], + [LeakageLengthOutwardsPhreaticLine4], + [LeakageLengthInwardsPhreaticLine4], + [PiezometricHeadPhreaticLine2Outwards], + [PiezometricHeadPhreaticLine2Inwards], + [LocationInputExtremeWaterLevelPolder], + [LocationInputExtremeUseDefaultOffsets], + [LocationInputExtremePhreaticLineOffsetBelowDikeTopAtRiver], + [LocationInputExtremePhreaticLineOffsetBelowDikeTopAtPolder], + [LocationInputExtremePhreaticLineOffsetBelowShoulderBaseInside], + [LocationInputExtremePhreaticLineOffsetDikeToeAtPolder], + [LocationInputExtremePenetrationLength], + [LocationInputDailyWaterLevelPolder], + [LocationInputDailyUseDefaultOffsets], + [LocationInputDailyPhreaticLineOffsetBelowDikeTopAtRiver], + [LocationInputDailyPhreaticLineOffsetBelowDikeTopAtPolder], + [LocationInputDailyPhreaticLineOffsetBelowShoulderBaseInside], + [LocationInputDailyPhreaticLineOffsetDikeToeAtPolder], + [CreateZones], + [ZoningBoundariesDeterminationType], + [ZoneBoundaryLeft], + [ZoneBoundaryRight]) +SELECT + [MacroStabilityInwardsCalculationEntityId], + [CalculationGroupEntityId], + [SurfaceLineEntityId], + [MacroStabilityInwardsStochasticSoilProfileEntityId], + [HydraulicLocationEntityId], + [Order], + [Name], + [Comment], + [RelevantForScenario], + CASE + WHEN [ScenarioContribution] IS NULL + OR [ScenarioContribution] < 0 + THEN 0 + WHEN [ScenarioContribution] > 1 + THEN 1 + ELSE + [ScenarioContribution] + END, + [AssessmentLevel], + [UseAssessmentLevelManualInput], + [SlipPlaneMinimumDepth], + [SlipPlaneMinimumLength], + [MaximumSliceWidth], + [MoveGrid], + [GridDeterminationType], + [TangentLineDeterminationType], + [TangentLineZTop], + [TangentLineZBottom], + [TangentLineNumber], + [LeftGridXLeft], + [LeftGridXRight], + [LeftGridNrOfHorizontalPoints], + [LeftGridZTop], + [LeftGridZBottom], + [LeftGridNrOfVerticalPoints], + [RightGridXLeft], + [RightGridXRight], + [RightGridNrOfHorizontalPoints], + [RightGridZTop], + [RightGridZBottom], + [RightGridNrOfVerticalPoints], + [DikeSoilScenario], + [WaterLevelRiverAverage], + [DrainageConstructionPresent], + [DrainageConstructionCoordinateX], + [DrainageConstructionCoordinateZ], + [MinimumLevelPhreaticLineAtDikeTopRiver], + [MinimumLevelPhreaticLineAtDikeTopPolder], + [AdjustPhreaticLine3And4ForUplift], + [LeakageLengthOutwardsPhreaticLine3], + [LeakageLengthInwardsPhreaticLine3], + [LeakageLengthOutwardsPhreaticLine4], + [LeakageLengthInwardsPhreaticLine4], + [PiezometricHeadPhreaticLine2Outwards], + [PiezometricHeadPhreaticLine2Inwards], + [LocationInputExtremeWaterLevelPolder], + [LocationInputExtremeUseDefaultOffsets], + [LocationInputExtremePhreaticLineOffsetBelowDikeTopAtRiver], + [LocationInputExtremePhreaticLineOffsetBelowDikeTopAtPolder], + [LocationInputExtremePhreaticLineOffsetBelowShoulderBaseInside], + [LocationInputExtremePhreaticLineOffsetDikeToeAtPolder], + [LocationInputExtremePenetrationLength], + [LocationInputDailyWaterLevelPolder], + [LocationInputDailyUseDefaultOffsets], + [LocationInputDailyPhreaticLineOffsetBelowDikeTopAtRiver], + [LocationInputDailyPhreaticLineOffsetBelowDikeTopAtPolder], + [LocationInputDailyPhreaticLineOffsetBelowShoulderBaseInside], + [LocationInputDailyPhreaticLineOffsetDikeToeAtPolder], + [CreateZones], + [ZoningBoundariesDeterminationType], + [ZoneBoundaryLeft], + [ZoneBoundaryRight] +FROM [SOURCEPROJECT].MacroStabilityInwardsCalculationEntity; +INSERT INTO MacroStabilityInwardsCharacteristicPointEntity SELECT * FROM [SOURCEPROJECT].MacroStabilityInwardsCharacteristicPointEntity; +INSERT INTO MacroStabilityInwardsFailureMechanismMetaEntity SELECT * FROM [SOURCEPROJECT].MacroStabilityInwardsFailureMechanismMetaEntity; +INSERT INTO MacroStabilityInwardsPreconsolidationStressEntity SELECT * FROM [SOURCEPROJECT].MacroStabilityInwardsPreconsolidationStressEntity; +INSERT INTO MacroStabilityInwardsSectionResultEntity SELECT * FROM [SOURCEPROJECT].MacroStabilityInwardsSectionResultEntity; +INSERT INTO MacroStabilityInwardsSoilLayerOneDEntity SELECT * FROM [SOURCEPROJECT].MacroStabilityInwardsSoilLayerOneDEntity; +INSERT INTO MacroStabilityInwardsSoilLayerTwoDEntity SELECT * FROM [SOURCEPROJECT].MacroStabilityInwardsSoilLayerTwoDEntity; +INSERT INTO MacroStabilityInwardsSoilProfileOneDEntity SELECT * FROM [SOURCEPROJECT].MacroStabilityInwardsSoilProfileOneDEntity; +INSERT INTO MacroStabilityInwardsSoilProfileTwoDEntity SELECT * FROM [SOURCEPROJECT].MacroStabilityInwardsSoilProfileTwoDEntity; +INSERT INTO MacroStabilityInwardsSoilProfileTwoDSoilLayerTwoDEntity SELECT * FROM [SOURCEPROJECT].MacroStabilityInwardsSoilProfileTwoDSoilLayerTwoDEntity; +INSERT INTO MacroStabilityInwardsStochasticSoilProfileEntity SELECT * FROM [SOURCEPROJECT].MacroStabilityInwardsStochasticSoilProfileEntity; +INSERT INTO MacroStabilityOutwardsFailureMechanismMetaEntity SELECT * FROM [SOURCEPROJECT].MacroStabilityOutwardsFailureMechanismMetaEntity; +INSERT INTO MacroStabilityOutwardsSectionResultEntity SELECT * FROM [SOURCEPROJECT].MacroStabilityOutwardsSectionResultEntity; +INSERT INTO MicrostabilitySectionResultEntity SELECT * FROM [SOURCEPROJECT].MicrostabilitySectionResultEntity; +INSERT INTO SemiProbabilisticPipingCalculationEntity( + [SemiProbabilisticPipingCalculationEntityId], + [CalculationGroupEntityId], + [SurfaceLineEntityId], + [PipingStochasticSoilProfileEntityId], + [HydraulicLocationEntityId], + [Order], + [Name], + [Comments], + [EntryPointL], + [ExitPointL], + [PhreaticLevelExitMean], + [PhreaticLevelExitStandardDeviation], + [DampingFactorExitMean], + [DampingFactorExitStandardDeviation], + [RelevantForScenario], + [ScenarioContribution], + [AssessmentLevel], + [UseAssessmentLevelManualInput]) +SELECT + [PipingCalculationEntityId], + [CalculationGroupEntityId], + [SurfaceLineEntityId], + [PipingStochasticSoilProfileEntityId], + [HydraulicLocationEntityId], + [Order], + [Name], + [Comments], + [EntryPointL], + [ExitPointL], + [PhreaticLevelExitMean], + [PhreaticLevelExitStandardDeviation], + [DampingFactorExitMean], + [DampingFactorExitStandardDeviation], + [RelevantForScenario], + CASE + WHEN [ScenarioContribution] IS NULL + OR [ScenarioContribution] < 0 + THEN 0 + WHEN [ScenarioContribution] > 1 + THEN 1 + ELSE + [ScenarioContribution] + END, + [AssessmentLevel], + [UseAssessmentLevelManualInput] +FROM [SOURCEPROJECT].PipingCalculationEntity; +INSERT INTO SemiProbabilisticPipingCalculationOutputEntity( + [SemiProbabilisticPipingCalculationOutputEntityId], + [SemiProbabilisticPipingCalculationEntityId], + [Order], + [HeaveFactorOfSafety], + [UpliftFactorOfSafety], + [SellmeijerFactorOfSafety], + [UpliftEffectiveStress], + [HeaveGradient], + [SellmeijerCreepCoefficient], + [SellmeijerCriticalFall], + [SellmeijerReducedFall]) +SELECT + [PipingCalculationOutputEntityId], + [PipingCalculationEntityId], + [Order], + [HeaveFactorOfSafety], + [UpliftFactorOfSafety], + [SellmeijerFactorOfSafety], + [UpliftEffectiveStress], + [HeaveGradient], + [SellmeijerCreepCoefficient], + [SellmeijerCriticalFall], + [SellmeijerReducedFall] +FROM [SOURCEPROJECT].PipingCalculationOutputEntity +WHERE PipingCalculationEntityId IN ( + SELECT PipingCalculationEntityId + FROM [SOURCEPROJECT].PipingCalculationEntity + WHERE UseAssessmentLevelManualInput IS 1 + ); +INSERT INTO PipingCharacteristicPointEntity SELECT * FROM [SOURCEPROJECT].PipingCharacteristicPointEntity; +INSERT INTO PipingFailureMechanismMetaEntity SELECT * FROM [SOURCEPROJECT].PipingFailureMechanismMetaEntity; +INSERT INTO PipingSectionResultEntity SELECT * FROM [SOURCEPROJECT].PipingSectionResultEntity; +INSERT INTO PipingSoilLayerEntity SELECT * FROM [SOURCEPROJECT].PipingSoilLayerEntity; +INSERT INTO PipingSoilProfileEntity SELECT * FROM [SOURCEPROJECT].PipingSoilProfileEntity; +INSERT INTO PipingStochasticSoilProfileEntity SELECT * FROM [SOURCEPROJECT].PipingStochasticSoilProfileEntity; +INSERT INTO PipingStructureFailureMechanismMetaEntity SELECT * FROM [SOURCEPROJECT].PipingStructureFailureMechanismMetaEntity; +INSERT INTO PipingStructureSectionResultEntity SELECT * FROM [SOURCEPROJECT].PipingStructureSectionResultEntity; +INSERT INTO ProjectEntity SELECT * FROM [SOURCEPROJECT].ProjectEntity; +INSERT INTO StabilityPointStructureEntity SELECT * FROM [SOURCEPROJECT].StabilityPointStructureEntity; +INSERT INTO StabilityPointStructuresCalculationEntity( + [StabilityPointStructuresCalculationEntityId], + [CalculationGroupEntityId], + [ForeshoreProfileEntityId], + [HydraulicLocationEntityId], + [StabilityPointStructureEntityId], + [Order], + [Name], + [Comments], + [UseBreakWater], + [BreakWaterType], + [BreakWaterHeight], + [UseForeshore], + [StructureNormalOrientation], + [StorageStructureAreaMean], + [StorageStructureAreaCoefficientOfVariation], + [AllowedLevelIncreaseStorageMean], + [AllowedLevelIncreaseStorageStandardDeviation], + [WidthFlowAperturesMean], + [WidthFlowAperturesStandardDeviation], + [InsideWaterLevelMean], + [InsideWaterLevelStandardDeviation], + [ThresholdHeightOpenWeirMean], + [ThresholdHeightOpenWeirStandardDeviation], + [CriticalOvertoppingDischargeMean], + [CriticalOvertoppingDischargeCoefficientOfVariation], + [FlowWidthAtBottomProtectionMean], + [FlowWidthAtBottomProtectionStandardDeviation], + [ConstructiveStrengthLinearLoadModelMean], + [ConstructiveStrengthLinearLoadModelCoefficientOfVariation], + [ConstructiveStrengthQuadraticLoadModelMean], + [ConstructiveStrengthQuadraticLoadModelCoefficientOfVariation], + [BankWidthMean], + [BankWidthStandardDeviation], + [InsideWaterLevelFailureConstructionMean], + [InsideWaterLevelFailureConstructionStandardDeviation], + [EvaluationLevel], + [LevelCrestStructureMean], + [LevelCrestStructureStandardDeviation], + [VerticalDistance], + [FailureProbabilityRepairClosure], + [FailureCollisionEnergyMean], + [FailureCollisionEnergyCoefficientOfVariation], + [ShipMassMean], + [ShipMassCoefficientOfVariation], + [ShipVelocityMean], + [ShipVelocityCoefficientOfVariation], + [LevellingCount], + [ProbabilityCollisionSecondaryStructure], + [FlowVelocityStructureClosableMean], + [StabilityLinearLoadModelMean], + [StabilityLinearLoadModelCoefficientOfVariation], + [StabilityQuadraticLoadModelMean], + [StabilityQuadraticLoadModelCoefficientOfVariation], + [AreaFlowAperturesMean], + [AreaFlowAperturesStandardDeviation], + [InflowModelType], + [LoadSchematizationType], + [VolumicWeightWater], + [StormDurationMean], + [FactorStormDurationOpenStructure], + [DrainCoefficientMean], + [DrainCoefficientStandardDeviation], + [FailureProbabilityStructureWithErosion], + [ShouldIllustrationPointsBeCalculated], + [RelevantForScenario], + [ScenarioContribution]) +SELECT + [StabilityPointStructuresCalculationEntityId], + [CalculationGroupEntityId], + [ForeshoreProfileEntityId], + [HydraulicLocationEntityId], + [StabilityPointStructureEntityId], + [Order], + [Name], + [Comments], + [UseBreakWater], + [BreakWaterType], + [BreakWaterHeight], + [UseForeshore], + [StructureNormalOrientation], + [StorageStructureAreaMean], + [StorageStructureAreaCoefficientOfVariation], + [AllowedLevelIncreaseStorageMean], + [AllowedLevelIncreaseStorageStandardDeviation], + [WidthFlowAperturesMean], + [WidthFlowAperturesStandardDeviation], + [InsideWaterLevelMean], + [InsideWaterLevelStandardDeviation], + [ThresholdHeightOpenWeirMean], + [ThresholdHeightOpenWeirStandardDeviation], + [CriticalOvertoppingDischargeMean], + [CriticalOvertoppingDischargeCoefficientOfVariation], + [FlowWidthAtBottomProtectionMean], + [FlowWidthAtBottomProtectionStandardDeviation], + [ConstructiveStrengthLinearLoadModelMean], + [ConstructiveStrengthLinearLoadModelCoefficientOfVariation], + [ConstructiveStrengthQuadraticLoadModelMean], + [ConstructiveStrengthQuadraticLoadModelCoefficientOfVariation], + [BankWidthMean], + [BankWidthStandardDeviation], + [InsideWaterLevelFailureConstructionMean], + [InsideWaterLevelFailureConstructionStandardDeviation], + [EvaluationLevel], + [LevelCrestStructureMean], + [LevelCrestStructureStandardDeviation], + [VerticalDistance], + [FailureProbabilityRepairClosure], + [FailureCollisionEnergyMean], + [FailureCollisionEnergyCoefficientOfVariation], + [ShipMassMean], + [ShipMassCoefficientOfVariation], + [ShipVelocityMean], + [ShipVelocityCoefficientOfVariation], + [LevellingCount], + [ProbabilityCollisionSecondaryStructure], + [FlowVelocityStructureClosableMean], + [StabilityLinearLoadModelMean], + [StabilityLinearLoadModelCoefficientOfVariation], + [StabilityQuadraticLoadModelMean], + [StabilityQuadraticLoadModelCoefficientOfVariation], + [AreaFlowAperturesMean], + [AreaFlowAperturesStandardDeviation], + [InflowModelType], + [LoadSchematizationType], + [VolumicWeightWater], + [StormDurationMean], + [FactorStormDurationOpenStructure], + [DrainCoefficientMean], + 0.2, + [FailureProbabilityStructureWithErosion], + [ShouldIllustrationPointsBeCalculated], + CASE + WHEN IsLinkedToSectionResult IS NOT NULL + THEN 1 + ELSE 0 + END, + CASE + WHEN IsLinkedToSectionResult IS NOT NULL + THEN 1 + ELSE 0 + END +FROM [SOURCEPROJECT].StabilityPointStructuresCalculationEntity +LEFT JOIN( + SELECT + StabilityPointStructuresCalculationEntityId, + CASE + WHEN StabilityPointStructuresSectionResultEntityId IS NOT NULL + THEN 1 + ELSE 0 + END AS IsLinkedToSectionResult + FROM [SOURCEPROJECT].StabilityPointStructuresSectionResultEntity) +USING(StabilityPointStructuresCalculationEntityId); +INSERT INTO StabilityPointStructuresFailureMechanismMetaEntity SELECT * FROM [SOURCEPROJECT].StabilityPointStructuresFailureMechanismMetaEntity; +INSERT INTO StabilityPointStructuresSectionResultEntity ( + [StabilityPointStructuresSectionResultEntityId], + [FailureMechanismSectionEntityId], + [SimpleAssessmentResult], + [DetailedAssessmentResult], + [TailorMadeAssessmentResult], + [TailorMadeAssessmentProbability], + [UseManualAssembly], + [ManualAssemblyProbability]) +SELECT + [StabilityPointStructuresSectionResultEntityId], + [FailureMechanismSectionEntityId], + [SimpleAssessmentResult], + [DetailedAssessmentResult], + [TailorMadeAssessmentResult], + [TailorMadeAssessmentProbability], + [UseManualAssembly], + [ManualAssemblyProbability] +FROM [SOURCEPROJECT].StabilityPointStructuresSectionResultEntity; +INSERT INTO StabilityStoneCoverFailureMechanismMetaEntity SELECT * FROM [SOURCEPROJECT].StabilityStoneCoverFailureMechanismMetaEntity; +INSERT INTO StabilityStoneCoverSectionResultEntity SELECT * FROM [SOURCEPROJECT].StabilityStoneCoverSectionResultEntity; +INSERT INTO StabilityStoneCoverWaveConditionsCalculationEntity SELECT * FROM [SOURCEPROJECT].StabilityStoneCoverWaveConditionsCalculationEntity; +INSERT INTO StochastEntity SELECT * FROM [SOURCEPROJECT].StochastEntity; +INSERT INTO StochasticSoilModelEntity SELECT * FROM [SOURCEPROJECT].StochasticSoilModelEntity; +INSERT INTO StrengthStabilityLengthwiseConstructionSectionResultEntity SELECT * FROM [SOURCEPROJECT].StrengthStabilityLengthwiseConstructionSectionResultEntity; +INSERT INTO SurfaceLineEntity SELECT * FROM [SOURCEPROJECT].SurfaceLineEntity; +INSERT INTO TechnicalInnovationSectionResultEntity SELECT * FROM [SOURCEPROJECT].TechnicalInnovationSectionResultEntity; +INSERT INTO VersionEntity ( + [VersionId], + [Version], + [Timestamp], + [FingerPrint]) +SELECT [VersionId], + "21.1", + [Timestamp], + [FingerPrint] +FROM [SOURCEPROJECT].VersionEntity; +INSERT INTO WaterPressureAsphaltCoverSectionResultEntity SELECT * FROM [SOURCEPROJECT].WaterPressureAsphaltCoverSectionResultEntity; +INSERT INTO WaveImpactAsphaltCoverFailureMechanismMetaEntity SELECT * FROM [SOURCEPROJECT].WaveImpactAsphaltCoverFailureMechanismMetaEntity; +INSERT INTO WaveImpactAsphaltCoverSectionResultEntity SELECT * FROM [SOURCEPROJECT].WaveImpactAsphaltCoverSectionResultEntity; +INSERT INTO WaveImpactAsphaltCoverWaveConditionsCalculationEntity SELECT * FROM [SOURCEPROJECT].WaveImpactAsphaltCoverWaveConditionsCalculationEntity; + +/* +Outputs that used HydraRing are not migrated +*/ +-- ClosingStructuresOutputEntity +-- DuneLocationOutputEntity +-- GrassCoverErosionInwardsDikeHeightOutputEntity +-- GrassCoverErosionInwardsOutputEntity +-- GrassCoverErosionInwardsOvertoppingRateOutputEntity +-- GrassCoverErosionOutwardsWaveConditionsOutputEntity +-- HeightStructuresOutputEntity +-- HydraulicLocationOutputEntity +-- PipingCalculationOutputEntity where UseManualAssessmentLevel is 0 +-- StabilityPointStructuresOutputEntity +-- StabilityStoneCoverWaveConditionsOutputEntity +-- WaveImpactAsphaltCoverWaveConditionsOutputEntity +-- FaultTreeIllustrationPointEntity +-- FaultTreeIllustrationPointStochastEntity +-- FaultTreeSubMechanismIllustrationPointEntity +-- GeneralResultFaultTreeIllustrationPointEntity +-- GeneralResultFaultTreeIllustrationPointStochastEntity +-- GeneralResultSubMechanismIllustrationPointEntity +-- GeneralResultSubMechanismIllustrationPointStochastEntity +-- IllustrationPointResultEntity +-- SubMechanismIllustrationPointEntity +-- SubMechanismIllustrationPointStochastEntity +-- TopLevelFaultTreeIllustrationPointEntity +-- TopLevelSubMechanismIllustrationPointEntity + +/* + Outputs that used MacroStabilityInwards kernel are not migrated + */ + -- MacroStabilityInwardsCalculationOutputEntity + +/* +Write migration logging +*/ +ATTACH DATABASE "{1}" AS LOGDATABASE; + +CREATE TABLE IF NOT EXISTS [LOGDATABASE].'MigrationLogEntity' +( + 'MigrationLogEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + 'FromVersion' VARCHAR(20) NOT NULL, + 'ToVersion' VARCHAR(20) NOT NULL, + 'LogMessage' TEXT NOT NULL +); + +INSERT INTO [LOGDATABASE].MigrationLogEntity ( + [FromVersion], + [ToVersion], + [LogMessage]) +VALUES ("19.1", "21.1", "Gevolgen van de migratie van versie 19.1 naar versie 21.1:"); + +CREATE TEMP TABLE TempLogOutputDeleted +( + 'NrDeleted' INTEGER NOT NULL +); + +INSERT INTO TempLogOutputDeleted SELECT COUNT() FROM [SOURCEPROJECT].HydraulicLocationOutputEntity; +INSERT INTO TempLogOutputDeleted SELECT COUNT() FROM [SOURCEPROJECT].ClosingStructuresOutputEntity; +INSERT INTO TempLogOutputDeleted SELECT COUNT() FROM [SOURCEPROJECT].DuneLocationCalculationOutputEntity; +INSERT INTO TempLogOutputDeleted SELECT COUNT() FROM [SOURCEPROJECT].GrassCoverErosionInwardsDikeHeightOutputEntity; +INSERT INTO TempLogOutputDeleted SELECT COUNT() FROM [SOURCEPROJECT].GrassCoverErosionInwardsOutputEntity; +INSERT INTO TempLogOutputDeleted SELECT COUNT() FROM [SOURCEPROJECT].GrassCoverErosionInwardsOvertoppingRateOutputEntity; +INSERT INTO TempLogOutputDeleted SELECT COUNT() FROM [SOURCEPROJECT].GrassCoverErosionOutwardsWaveConditionsOutputEntity; +INSERT INTO TempLogOutputDeleted SELECT COUNT() FROM [SOURCEPROJECT].HeightStructuresOutputEntity; +INSERT INTO TempLogOutputDeleted SELECT COUNT() FROM [SOURCEPROJECT].StabilityPointStructuresOutputEntity; +INSERT INTO TempLogOutputDeleted SELECT COUNT() FROM [SOURCEPROJECT].StabilityStoneCoverWaveConditionsOutputEntity; +INSERT INTO TempLogOutputDeleted SELECT COUNT() FROM [SOURCEPROJECT].WaveImpactAsphaltCoverWaveConditionsOutputEntity; +INSERT INTO TempLogOutputDeleted +SELECT COUNT() +FROM [SOURCEPROJECT].PipingCalculationOutputEntity +WHERE PipingCalculationEntityId IN ( + SELECT PipingCalculationEntityId + FROM [SOURCEPROJECT].PipingCalculationEntity + WHERE UseAssessmentLevelManualInput IS 0 + ); + +CREATE TEMP TABLE TempLogOutputRemaining +( + 'NrRemaining' INTEGER NOT NULL +); +INSERT INTO TempLogOutputRemaining +SELECT COUNT() +FROM [SOURCEPROJECT].PipingCalculationOutputEntity +WHERE PipingCalculationEntityId IN ( + SELECT PipingCalculationEntityId + FROM [SOURCEPROJECT].PipingCalculationEntity + WHERE UseAssessmentLevelManualInput IS 1 + ); + +INSERT INTO [LOGDATABASE].MigrationLogEntity ( + [FromVersion], + [ToVersion], + [LogMessage]) +SELECT + "19.1", + "21.1", + CASE + WHEN [NrRemaining] > 0 + THEN "* Alle berekende resultaten zijn verwijderd, behalve die van het toetsspoor 'Piping' waarbij de waterstand handmatig is ingevuld." + ELSE "* Alle berekende resultaten zijn verwijderd." + END +FROM TempLogOutputDeleted + LEFT JOIN TempLogOutputRemaining +WHERE [NrDeleted] > 0 + LIMIT 1; + +DROP TABLE TempLogOutputDeleted; +DROP TABLE TempLogOutputRemaining; + +CREATE TEMP TABLE TempPipingValuesAdjusted +( + 'NrAdjusted' INTEGER NOT NULL +); + +INSERT INTO TempPipingValuesAdjusted SELECT COUNT() FROM [SOURCEPROJECT].PipingCalculationEntity +WHERE ( + [ScenarioContribution] > 1.0 + OR [ScenarioContribution] < 0.0 + OR [ScenarioContribution] IS NULL + ); + +INSERT INTO [LOGDATABASE].MigrationLogEntity ( + [FromVersion], + [ToVersion], + [LogMessage]) +SELECT + "19.1", + "21.1", + "* Alle scenario bijdragen van het toetsspoor 'Piping' waarbij de bijdrage groter is dan 100% of kleiner dan 0% zijn aangepast naar respectievelijk 100% en 0%." +FROM TempPipingValuesAdjusted +WHERE [NrAdjusted] > 0 + LIMIT 1; + +DROP TABLE TempPipingValuesAdjusted; + +CREATE TEMP TABLE TempMacroStabilityInwardsValuesAdjusted +( + 'NrAdjusted' INTEGER NOT NULL +); + +INSERT INTO TempMacroStabilityInwardsValuesAdjusted SELECT COUNT() FROM [SOURCEPROJECT].MacroStabilityInwardsCalculationEntity +WHERE ( + [ScenarioContribution] > 1.0 + OR [ScenarioContribution] < 0.0 + OR [ScenarioContribution] IS NULL + ); + +INSERT INTO [LOGDATABASE].MigrationLogEntity ( + [FromVersion], + [ToVersion], +[LogMessage]) +SELECT + "19.1", + "21.1", + "* Alle scenario bijdragen van het toetsspoor 'Macrostabiliteit Binnenwaarts' waarbij de bijdrage groter is dan 100% of kleiner dan 0% zijn aangepast naar respectievelijk 100% en 0%." +FROM TempMacroStabilityInwardsValuesAdjusted +WHERE [NrAdjusted] > 0 + LIMIT 1; + +DROP TABLE TempMacroStabilityInwardsValuesAdjusted; + +INSERT INTO [LOGDATABASE].MigrationLogEntity ( + [FromVersion], + [ToVersion], + [LogMessage]) +SELECT + "19.1", + "21.1", + "* Geen aanpassingen." + WHERE ( + SELECT COUNT() FROM [LOGDATABASE].MigrationLogEntity + WHERE [FromVersion] = "19.1" + ) IS 1; + +DETACH LOGDATABASE; + +DETACH SOURCEPROJECT; + +PRAGMA foreign_keys = ON; \ No newline at end of file Index: Riskeer/Migration/src/Riskeer.Migration.Core/Riskeer.Migration.Core.csproj =================================================================== diff -u -rd993e5ebe5851ea9c65753d8709d73a926a24afd -r22a1505cd4329747b28df26d6042e997eca20882 --- Riskeer/Migration/src/Riskeer.Migration.Core/Riskeer.Migration.Core.csproj (.../Riskeer.Migration.Core.csproj) (revision d993e5ebe5851ea9c65753d8709d73a926a24afd) +++ Riskeer/Migration/src/Riskeer.Migration.Core/Riskeer.Migration.Core.csproj (.../Riskeer.Migration.Core.csproj) (revision 22a1505cd4329747b28df26d6042e997eca20882) @@ -42,8 +42,8 @@ - - + + Index: Riskeer/Migration/test/Riskeer.Migration.Core.Test/test-data/MigrationTestProject201.risk =================================================================== diff -u -r8f223d35ced102ff207cff304cefadde224a17ef -r22a1505cd4329747b28df26d6042e997eca20882 Binary files differ Index: Riskeer/Migration/test/Riskeer.Migration.Core.Test/test-data/MigrationTestProject211.risk =================================================================== diff -u Binary files differ Index: Riskeer/Migration/test/Riskeer.Migration.Integration.Test/MigrationIntegrationTest.cs =================================================================== diff -u -r22d0cea5d78a3ebfc9d2b6f33519001d4918deab -r22a1505cd4329747b28df26d6042e997eca20882 --- Riskeer/Migration/test/Riskeer.Migration.Integration.Test/MigrationIntegrationTest.cs (.../MigrationIntegrationTest.cs) (revision 22d0cea5d78a3ebfc9d2b6f33519001d4918deab) +++ Riskeer/Migration/test/Riskeer.Migration.Integration.Test/MigrationIntegrationTest.cs (.../MigrationIntegrationTest.cs) (revision 22a1505cd4329747b28df26d6042e997eca20882) @@ -159,7 +159,7 @@ yield return new FileToMigrate("Empty valid Release 17.2.rtd", "17.3"); yield return new FileToMigrate("Empty valid Release 17.3.rtd", "18.1"); yield return new FileToMigrate("Empty valid Release 18.1.rtd", "19.1"); - yield return new FileToMigrate("Empty valid Release 19.1.risk", "20.1"); + yield return new FileToMigrate("Empty valid Release 19.1.risk", "21.1"); } private class FileToMigrate Fisheye: Tag 22a1505cd4329747b28df26d6042e997eca20882 refers to a dead (removed) revision in file `Riskeer/Migration/test/Riskeer.Migration.Integration.Test/MigrationTo201IntegrationTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Riskeer/Migration/test/Riskeer.Migration.Integration.Test/MigrationTo211IntegrationTest.cs =================================================================== diff -u --- Riskeer/Migration/test/Riskeer.Migration.Integration.Test/MigrationTo211IntegrationTest.cs (revision 0) +++ Riskeer/Migration/test/Riskeer.Migration.Integration.Test/MigrationTo211IntegrationTest.cs (revision 22a1505cd4329747b28df26d6042e997eca20882) @@ -0,0 +1,1297 @@ +// Copyright (C) Stichting Deltares 2019. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using Core.Common.TestUtil; +using NUnit.Framework; +using Riskeer.Migration.Core; +using Riskeer.Migration.Core.TestUtil; + +namespace Riskeer.Migration.Integration.Test +{ + [TestFixture] + public class MigrationTo211IntegrationTest + { + private const string newVersion = "21.1"; + + [Test] + [TestCaseSource(nameof(GetMigrationProjectsWithMessages))] + public void Given191Project_WhenUpgradedTo201_ThenProjectAsExpected(string filePath, string[] expectedMessages) + { + // Given + string sourceFilePath = TestHelper.GetTestDataPath(TestDataPath.Riskeer.Migration.Core, + filePath); + var fromVersionedFile = new ProjectVersionedFile(sourceFilePath); + + string targetFilePath = TestHelper.GetScratchPadPath(nameof(Given191Project_WhenUpgradedTo201_ThenProjectAsExpected)); + string logFilePath = TestHelper.GetScratchPadPath(string.Concat(nameof(Given191Project_WhenUpgradedTo201_ThenProjectAsExpected), ".log")); + var migrator = new ProjectFileMigrator + { + LogPath = logFilePath + }; + + using (new FileDisposeHelper(logFilePath)) + using (new FileDisposeHelper(targetFilePath)) + { + // When + migrator.Migrate(fromVersionedFile, newVersion, targetFilePath); + + // Then + using (var reader = new MigratedDatabaseReader(targetFilePath)) + { + AssertTablesContentMigrated(reader, sourceFilePath); + + AssertVersions(reader); + AssertDatabase(reader); + + AssertHydraulicLocationOutput(reader); + + AssertGrassCoverErosionInwardsCalculation(reader, sourceFilePath); + AssertGrassCoverErosionInwardsOutput(reader); + AssertGrassCoverErosionInwardsSectionResult(reader, sourceFilePath); + + AssertGrassCoverErosionOutwardsOutput(reader); + AssertStabilityStoneCoverOutput(reader); + AssertWaveImpactAsphaltCoverOutput(reader); + + AssertClosingStructuresCalculation(reader, sourceFilePath); + AssertClosingStructuresOutput(reader); + AssertClosingStructuresSectionResult(reader, sourceFilePath); + + AssertHeightStructuresCalculation(reader, sourceFilePath); + AssertHeightStructuresOutput(reader); + AssertHeightStructuresSectionResult(reader, sourceFilePath); + + AssertStabilityPointStructuresCalculation(reader, sourceFilePath); + AssertStabilityPointStructuresOutput(reader); + AssertStabilityPointStructuresSectionResult(reader, sourceFilePath); + + AssertMacroStabilityInwardsCalculation(reader, sourceFilePath); + AssertMacroStabilityInwardsOutput(reader); + + AssertPipingCalculation(reader, sourceFilePath); + AssertPipingOutput(reader, sourceFilePath); + + AssertDuneLocationOutput(reader); + + AssertIllustrationPointResults(reader); + } + + AssertLogDatabase(logFilePath, expectedMessages); + } + } + + private static IEnumerable GetMigrationProjectsWithMessages() + { + yield return new TestCaseData("MigrationTestProject191.risk", new[] + { + "Alle berekende resultaten zijn verwijderd, behalve die van het toetsspoor 'Piping' waarbij de waterstand handmatig is ingevuld.", + "Alle scenario bijdragen van het toetsspoor 'Piping' waarbij de bijdrage groter is dan 100% of kleiner dan 0% zijn aangepast naar respectievelijk 100% en 0%.", + "Alle scenario bijdragen van het toetsspoor 'Macrostabiliteit Binnenwaarts' waarbij de bijdrage groter is dan 100% of kleiner dan 0% zijn aangepast naar respectievelijk 100% en 0%." + }); + + yield return new TestCaseData("MigrationTestProject191NoManualAssessmentLevels.risk", new[] + { + "Alle berekende resultaten zijn verwijderd." + }); + + yield return new TestCaseData("MigrationTestProject191NoOutput.risk", new[] + { + "Geen aanpassingen." + }); + } + + private static void AssertHydraulicLocationOutput(MigratedDatabaseReader reader) + { + const string validateOutput = + "SELECT COUNT() = 0 " + + "FROM [HydraulicLocationOutputEntity]; "; + reader.AssertReturnedDataIsValid(validateOutput); + } + + private static void AssertGrassCoverErosionInwardsCalculation(MigratedDatabaseReader reader, string sourceFilePath) + { + string validateCalculationLinkedToSectionResult = + $"ATTACH DATABASE \"{sourceFilePath}\" AS SOURCEPROJECT; " + + "SELECT COUNT() = " + + "(" + + "SELECT COUNT() " + + "FROM SOURCEPROJECT.GrassCoverErosionInwardsCalculationEntity " + + "JOIN SOURCEPROJECT.GrassCoverErosionInwardsSectionResultEntity USING(GrassCoverErosionInwardsCalculationEntityId) " + + ") " + + "FROM GrassCoverErosionInwardsCalculationEntity NEW " + + "JOIN SOURCEPROJECT.GrassCoverErosionInwardsCalculationEntity OLD USING(GrassCoverErosionInwardsCalculationEntityId) " + + "WHERE NEW.[CalculationGroupEntityId] = OLD.[CalculationGroupEntityId] " + + "AND NEW.[HydraulicLocationEntityId] IS OLD.[HydraulicLocationEntityId] " + + "AND NEW.[DikeProfileEntityId] IS OLD.[DikeProfileEntityId]" + + "AND NEW.\"Order\" = OLD.\"Order\" " + + "AND NEW.[Name] IS OLD.[Name] " + + "AND NEW.[Comments] IS OLD.[Comments] " + + "AND NEW.[Orientation] IS OLD.[Orientation] " + + "AND NEW.[CriticalFlowRateMean] IS OLD.[CriticalFlowRateMean] " + + "AND NEW.[CriticalFlowRateStandardDeviation] IS OLD.[CriticalFlowRateStandardDeviation] " + + "AND NEW.[UseForeshore] = OLD.[UseForeshore] " + + "AND NEW.[DikeHeightCalculationType] = OLD.[DikeHeightCalculationType] " + + "AND NEW.[DikeHeight] IS OLD.[DikeHeight] " + + "AND NEW.[UseBreakWater] = OLD.[UseBreakWater] " + + "AND NEW.[BreakWaterType] IS OLD.[BreakWaterType] " + + "AND NEW.[BreakWaterHeight] IS OLD.[BreakWaterHeight] " + + "AND NEW.[OvertoppingRateCalculationType] = OLD.[OvertoppingRateCalculationType] " + + "AND NEW.[ShouldDikeHeightIllustrationPointsBeCalculated] = OLD.[ShouldDikeHeightIllustrationPointsBeCalculated] " + + "AND NEW.[ShouldOvertoppingRateIllustrationPointsBeCalculated] = OLD.[ShouldOvertoppingRateIllustrationPointsBeCalculated] " + + "AND NEW.[ShouldOvertoppingOutputIllustrationPointsBeCalculated] = OLD.[ShouldOvertoppingOutputIllustrationPointsBeCalculated] " + + "AND NEW.[RelevantForScenario] = 1 " + + "AND NEW.[ScenarioContribution] = 1; " + + "DETACH SOURCEPROJECT;"; + reader.AssertReturnedDataIsValid(validateCalculationLinkedToSectionResult); + + string validateCalculationNotLinkedToSectionResult = + $"ATTACH DATABASE \"{sourceFilePath}\" AS SOURCEPROJECT; " + + "SELECT COUNT() = " + + "(" + + "SELECT COUNT() " + + "FROM SOURCEPROJECT.GrassCoverErosionInwardsCalculationEntity " + + "LEFT JOIN SOURCEPROJECT.GrassCoverErosionInwardsSectionResultEntity " + + "USING(GrassCoverErosionInwardsCalculationEntityId) " + + "WHERE GrassCoverErosionInwardsSectionResultEntityId IS NULL" + + ") " + + "FROM GrassCoverErosionInwardsCalculationEntity NEW " + + "JOIN SOURCEPROJECT.GrassCoverErosionInwardsCalculationEntity OLD USING(GrassCoverErosionInwardsCalculationEntityId) " + + "WHERE NEW.[CalculationGroupEntityId] = OLD.[CalculationGroupEntityId] " + + "AND NEW.[HydraulicLocationEntityId] IS OLD.[HydraulicLocationEntityId] " + + "AND NEW.[DikeProfileEntityId] IS OLD.[DikeProfileEntityId]" + + "AND NEW.\"Order\" = OLD.\"Order\" " + + "AND NEW.[Name] IS OLD.[Name] " + + "AND NEW.[Comments] IS OLD.[Comments] " + + "AND NEW.[Orientation] IS OLD.[Orientation] " + + "AND NEW.[CriticalFlowRateMean] IS OLD.[CriticalFlowRateMean] " + + "AND NEW.[CriticalFlowRateStandardDeviation] IS OLD.[CriticalFlowRateStandardDeviation] " + + "AND NEW.[UseForeshore] = OLD.[UseForeshore] " + + "AND NEW.[DikeHeightCalculationType] = OLD.[DikeHeightCalculationType] " + + "AND NEW.[DikeHeight] IS OLD.[DikeHeight] " + + "AND NEW.[UseBreakWater] = OLD.[UseBreakWater] " + + "AND NEW.[BreakWaterType] IS OLD.[BreakWaterType] " + + "AND NEW.[BreakWaterHeight] IS OLD.[BreakWaterHeight] " + + "AND NEW.[OvertoppingRateCalculationType] = OLD.[OvertoppingRateCalculationType] " + + "AND NEW.[ShouldDikeHeightIllustrationPointsBeCalculated] = OLD.[ShouldDikeHeightIllustrationPointsBeCalculated] " + + "AND NEW.[ShouldOvertoppingRateIllustrationPointsBeCalculated] = OLD.[ShouldOvertoppingRateIllustrationPointsBeCalculated] " + + "AND NEW.[ShouldOvertoppingOutputIllustrationPointsBeCalculated] = OLD.[ShouldOvertoppingOutputIllustrationPointsBeCalculated] " + + "AND NEW.[RelevantForScenario] = 0 " + + "AND NEW.[ScenarioContribution] = 0; " + + "DETACH SOURCEPROJECT;"; + reader.AssertReturnedDataIsValid(validateCalculationNotLinkedToSectionResult); + } + + private static void AssertGrassCoverErosionInwardsOutput(MigratedDatabaseReader reader) + { + const string validateOutput = + "SELECT COUNT() = 0 " + + "FROM [GrassCoverErosionInwardsOutputEntity]; "; + reader.AssertReturnedDataIsValid(validateOutput); + + const string validateDikeHeightOutput = + "SELECT COUNT() = 0 " + + "FROM [GrassCoverErosionInwardsDikeHeightOutputEntity]; "; + reader.AssertReturnedDataIsValid(validateDikeHeightOutput); + + const string validateOvertoppingRateOutput = + "SELECT COUNT() = 0 " + + "FROM [GrassCoverErosionInwardsOvertoppingRateOutputEntity]; "; + reader.AssertReturnedDataIsValid(validateOvertoppingRateOutput); + } + + private static void AssertGrassCoverErosionInwardsSectionResult(MigratedDatabaseReader reader, string sourceFilePath) + { + string validateSectionResults = + $"ATTACH DATABASE \"{sourceFilePath}\" AS SOURCEPROJECT; " + + "SELECT COUNT() = " + + "(" + + "SELECT COUNT() " + + "FROM SOURCEPROJECT.GrassCoverErosionInwardsSectionResultEntity" + + ") " + + "FROM GrassCoverErosionInwardsSectionResultEntity NEW " + + "JOIN SOURCEPROJECT.GrassCoverErosionInwardsSectionResultEntity OLD USING(GrassCoverErosionInwardsSectionResultEntityId) " + + "WHERE NEW.[FailureMechanismSectionEntityId] = OLD.[FailureMechanismSectionEntityId] " + + "AND NEW.[SimpleAssessmentResult] = OLD.[SimpleAssessmentResult] " + + "AND NEW.[DetailedAssessmentResult] = OLD.[DetailedAssessmentResult] " + + "AND NEW.[TailorMadeAssessmentResult] = OLD.[TailorMadeAssessmentResult] " + + "AND NEW.[TailorMadeAssessmentProbability] IS OLD.[TailorMadeAssessmentProbability] " + + "AND NEW.[UseManualAssembly] = OLD.[UseManualAssembly] " + + "AND NEW.[ManualAssemblyProbability] IS OLD.[ManualAssemblyProbability]; " + + "DETACH SOURCEPROJECT;"; + reader.AssertReturnedDataIsValid(validateSectionResults); + } + + private static void AssertGrassCoverErosionOutwardsOutput(MigratedDatabaseReader reader) + { + const string validateOutput = + "SELECT COUNT() = 0 " + + "FROM [GrassCoverErosionOutwardsWaveConditionsOutputEntity]; "; + reader.AssertReturnedDataIsValid(validateOutput); + } + + private static void AssertStabilityStoneCoverOutput(MigratedDatabaseReader reader) + { + const string validateOutput = + "SELECT COUNT() = 0 " + + "FROM [StabilityStoneCoverWaveConditionsOutputEntity]; "; + reader.AssertReturnedDataIsValid(validateOutput); + } + + private static void AssertWaveImpactAsphaltCoverOutput(MigratedDatabaseReader reader) + { + const string validateOutput = + "SELECT COUNT() = 0 " + + "FROM [WaveImpactAsphaltCoverWaveConditionsOutputEntity]; "; + reader.AssertReturnedDataIsValid(validateOutput); + } + + private static void AssertClosingStructuresCalculation(MigratedDatabaseReader reader, string sourceFilePath) + { + string validateCalculationLinkedToSectionResult = + $"ATTACH DATABASE \"{sourceFilePath}\" AS SOURCEPROJECT; " + + "SELECT COUNT() = " + + "(" + + "SELECT COUNT() " + + "FROM SOURCEPROJECT.ClosingStructuresCalculationEntity " + + "JOIN SOURCEPROJECT.ClosingStructuresSectionResultEntity USING(ClosingStructuresCalculationEntityId) " + + ") " + + "FROM ClosingStructuresCalculationEntity NEW " + + "JOIN SOURCEPROJECT.ClosingStructuresCalculationEntity OLD USING(ClosingStructuresCalculationEntityId) " + + "WHERE NEW.[CalculationGroupEntityId] = OLD.[CalculationGroupEntityId] " + + "AND NEW.[ForeshoreProfileEntityId] IS OLD.[ForeshoreProfileEntityId] " + + "AND NEW.[HydraulicLocationEntityId] IS OLD.[HydraulicLocationEntityId] " + + "AND NEW.[ClosingStructureEntityId] IS OLD.[ClosingStructureEntityId]" + + "AND NEW.\"Order\" = OLD.\"Order\" " + + "AND NEW.[Name] IS OLD.[Name] " + + "AND NEW.[Comments] IS OLD.[Comments] " + + "AND NEW.[UseBreakWater] = OLD.[UseBreakWater] " + + "AND NEW.[BreakWaterType] IS OLD.[BreakWaterType] " + + "AND NEW.[BreakWaterHeight] IS OLD.[BreakWaterHeight] " + + "AND NEW.[UseForeshore] = OLD.[UseForeshore] " + + "AND NEW.[Orientation] IS OLD.[Orientation] " + + "AND NEW.[StructureNormalOrientation] IS OLD.[StructureNormalOrientation] " + + "AND NEW.[StorageStructureAreaMean] IS OLD.[StorageStructureAreaMean] " + + "AND NEW.[StorageStructureAreaCoefficientOfVariation] IS OLD.[StorageStructureAreaCoefficientOfVariation] " + + "AND NEW.[AllowedLevelIncreaseStorageMean] IS OLD.[AllowedLevelIncreaseStorageMean] " + + "AND NEW.[AllowedLevelIncreaseStorageStandardDeviation] IS OLD.[AllowedLevelIncreaseStorageStandardDeviation] " + + "AND NEW.[WidthFlowAperturesMean] IS OLD.[WidthFlowAperturesMean] " + + "AND NEW.[WidthFlowAperturesStandardDeviation] IS OLD.[WidthFlowAperturesStandardDeviation] " + + "AND NEW.[LevelCrestStructureNotClosingMean] IS OLD.[LevelCrestStructureNotClosingMean] " + + "AND NEW.[LevelCrestStructureNotClosingStandardDeviation] IS OLD.[LevelCrestStructureNotClosingStandardDeviation] " + + "AND NEW.[InsideWaterLevelMean] IS OLD.[InsideWaterLevelMean] " + + "AND NEW.[InsideWaterLevelStandardDeviation] IS OLD.[InsideWaterLevelStandardDeviation] " + + "AND NEW.[ThresholdHeightOpenWeirMean] IS OLD.[ThresholdHeightOpenWeirMean] " + + "AND NEW.[ThresholdHeightOpenWeirStandardDeviation] IS OLD.[ThresholdHeightOpenWeirStandardDeviation] " + + "AND NEW.[AreaFlowAperturesMean] IS OLD.[AreaFlowAperturesMean] " + + "AND NEW.[AreaFlowAperturesStandardDeviation] IS OLD.[AreaFlowAperturesStandardDeviation] " + + "AND NEW.[CriticalOvertoppingDischargeMean] IS OLD.[CriticalOvertoppingDischargeMean] " + + "AND NEW.[CriticalOvertoppingDischargeCoefficientOfVariation] IS OLD.[CriticalOvertoppingDischargeCoefficientOfVariation] " + + "AND NEW.[FlowWidthAtBottomProtectionMean] IS OLD.[FlowWidthAtBottomProtectionMean] " + + "AND NEW.[FlowWidthAtBottomProtectionStandardDeviation] IS OLD.[FlowWidthAtBottomProtectionStandardDeviation] " + + "AND NEW.[ProbabilityOpenStructureBeforeFlooding] = OLD.[ProbabilityOpenStructureBeforeFlooding] " + + "AND NEW.[FailureProbabilityOpenStructure] = OLD.[FailureProbabilityOpenStructure] " + + "AND NEW.[IdenticalApertures] = OLD.[IdenticalApertures] " + + "AND NEW.[FailureProbabilityReparation] = OLD.[FailureProbabilityReparation] " + + "AND NEW.[InflowModelType] = OLD.[InflowModelType] " + + "AND NEW.[FailureProbabilityStructureWithErosion] = OLD.[FailureProbabilityStructureWithErosion] " + + "AND NEW.[DeviationWaveDirection] IS OLD.[DeviationWaveDirection] " + + "AND NEW.[DrainCoefficientMean] IS OLD.[DrainCoefficientMean] " + + "AND NEW.[DrainCoefficientStandardDeviation] IS 0.2 " + + "AND NEW.[ModelFactorSuperCriticalFlowMean] IS OLD.[ModelFactorSuperCriticalFlowMean] " + + "AND NEW.[StormDurationMean] IS OLD.[StormDurationMean] " + + "AND NEW.[FactorStormDurationOpenStructure] IS OLD.[FactorStormDurationOpenStructure] " + + "AND NEW.[ShouldIllustrationPointsBeCalculated] = OLD.[ShouldIllustrationPointsBeCalculated] " + + "AND NEW.[RelevantForScenario] = 1 " + + "AND NEW.[ScenarioContribution] = 1; " + + "DETACH SOURCEPROJECT;"; + reader.AssertReturnedDataIsValid(validateCalculationLinkedToSectionResult); + + string validateCalculationNotLinkedToSectionResult = + $"ATTACH DATABASE \"{sourceFilePath}\" AS SOURCEPROJECT; " + + "SELECT COUNT() = " + + "(" + + "SELECT COUNT() " + + "FROM SOURCEPROJECT.ClosingStructuresCalculationEntity " + + "LEFT JOIN SOURCEPROJECT.ClosingStructuresSectionResultEntity " + + "USING(ClosingStructuresCalculationEntityId) " + + "WHERE ClosingStructuresSectionResultEntityId IS NULL" + + ") " + + "FROM ClosingStructuresCalculationEntity NEW " + + "JOIN SOURCEPROJECT.ClosingStructuresCalculationEntity OLD USING(ClosingStructuresCalculationEntityId) " + + "WHERE NEW.[CalculationGroupEntityId] = OLD.[CalculationGroupEntityId] " + + "AND NEW.[ForeshoreProfileEntityId] IS OLD.[ForeshoreProfileEntityId] " + + "AND NEW.[HydraulicLocationEntityId] IS OLD.[HydraulicLocationEntityId] " + + "AND NEW.[ClosingStructureEntityId] IS OLD.[ClosingStructureEntityId]" + + "AND NEW.\"Order\" = OLD.\"Order\" " + + "AND NEW.[Name] IS OLD.[Name] " + + "AND NEW.[Comments] IS OLD.[Comments] " + + "AND NEW.[UseBreakWater] = OLD.[UseBreakWater] " + + "AND NEW.[BreakWaterType] IS OLD.[BreakWaterType] " + + "AND NEW.[BreakWaterHeight] IS OLD.[BreakWaterHeight] " + + "AND NEW.[UseForeshore] = OLD.[UseForeshore] " + + "AND NEW.[Orientation] IS OLD.[Orientation] " + + "AND NEW.[StructureNormalOrientation] IS OLD.[StructureNormalOrientation] " + + "AND NEW.[StorageStructureAreaMean] IS OLD.[StorageStructureAreaMean] " + + "AND NEW.[StorageStructureAreaCoefficientOfVariation] IS OLD.[StorageStructureAreaCoefficientOfVariation] " + + "AND NEW.[AllowedLevelIncreaseStorageMean] IS OLD.[AllowedLevelIncreaseStorageMean] " + + "AND NEW.[AllowedLevelIncreaseStorageStandardDeviation] IS OLD.[AllowedLevelIncreaseStorageStandardDeviation] " + + "AND NEW.[WidthFlowAperturesMean] IS OLD.[WidthFlowAperturesMean] " + + "AND NEW.[WidthFlowAperturesStandardDeviation] IS OLD.[WidthFlowAperturesStandardDeviation] " + + "AND NEW.[LevelCrestStructureNotClosingMean] IS OLD.[LevelCrestStructureNotClosingMean] " + + "AND NEW.[LevelCrestStructureNotClosingStandardDeviation] IS OLD.[LevelCrestStructureNotClosingStandardDeviation] " + + "AND NEW.[InsideWaterLevelMean] IS OLD.[InsideWaterLevelMean] " + + "AND NEW.[InsideWaterLevelStandardDeviation] IS OLD.[InsideWaterLevelStandardDeviation] " + + "AND NEW.[ThresholdHeightOpenWeirMean] IS OLD.[ThresholdHeightOpenWeirMean] " + + "AND NEW.[ThresholdHeightOpenWeirStandardDeviation] IS OLD.[ThresholdHeightOpenWeirStandardDeviation] " + + "AND NEW.[AreaFlowAperturesMean] IS OLD.[AreaFlowAperturesMean] " + + "AND NEW.[AreaFlowAperturesStandardDeviation] IS OLD.[AreaFlowAperturesStandardDeviation] " + + "AND NEW.[CriticalOvertoppingDischargeMean] IS OLD.[CriticalOvertoppingDischargeMean] " + + "AND NEW.[CriticalOvertoppingDischargeCoefficientOfVariation] IS OLD.[CriticalOvertoppingDischargeCoefficientOfVariation] " + + "AND NEW.[FlowWidthAtBottomProtectionMean] IS OLD.[FlowWidthAtBottomProtectionMean] " + + "AND NEW.[FlowWidthAtBottomProtectionStandardDeviation] IS OLD.[FlowWidthAtBottomProtectionStandardDeviation] " + + "AND NEW.[ProbabilityOpenStructureBeforeFlooding] = OLD.[ProbabilityOpenStructureBeforeFlooding] " + + "AND NEW.[FailureProbabilityOpenStructure] = OLD.[FailureProbabilityOpenStructure] " + + "AND NEW.[IdenticalApertures] = OLD.[IdenticalApertures] " + + "AND NEW.[FailureProbabilityReparation] = OLD.[FailureProbabilityReparation] " + + "AND NEW.[InflowModelType] = OLD.[InflowModelType] " + + "AND NEW.[FailureProbabilityStructureWithErosion] = OLD.[FailureProbabilityStructureWithErosion] " + + "AND NEW.[DeviationWaveDirection] IS OLD.[DeviationWaveDirection] " + + "AND NEW.[DrainCoefficientMean] IS OLD.[DrainCoefficientMean] " + + "AND NEW.[DrainCoefficientStandardDeviation] IS 0.2 " + + "AND NEW.[ModelFactorSuperCriticalFlowMean] IS OLD.[ModelFactorSuperCriticalFlowMean] " + + "AND NEW.[StormDurationMean] IS OLD.[StormDurationMean] " + + "AND NEW.[FactorStormDurationOpenStructure] IS OLD.[FactorStormDurationOpenStructure] " + + "AND NEW.[ShouldIllustrationPointsBeCalculated] = OLD.[ShouldIllustrationPointsBeCalculated] " + + "AND NEW.[RelevantForScenario] = 0 " + + "AND NEW.[ScenarioContribution] = 0; " + + "DETACH SOURCEPROJECT;"; + reader.AssertReturnedDataIsValid(validateCalculationNotLinkedToSectionResult); + } + + private static void AssertClosingStructuresOutput(MigratedDatabaseReader reader) + { + const string validateOutput = + "SELECT COUNT() = 0 " + + "FROM [ClosingStructuresOutputEntity]; "; + reader.AssertReturnedDataIsValid(validateOutput); + } + + private static void AssertClosingStructuresSectionResult(MigratedDatabaseReader reader, string sourceFilePath) + { + string validateSectionResults = + $"ATTACH DATABASE \"{sourceFilePath}\" AS SOURCEPROJECT; " + + "SELECT COUNT() = " + + "(" + + "SELECT COUNT() " + + "FROM SOURCEPROJECT.ClosingStructuresSectionResultEntity" + + ") " + + "FROM ClosingStructuresSectionResultEntity NEW " + + "JOIN SOURCEPROJECT.ClosingStructuresSectionResultEntity OLD USING(ClosingStructuresSectionResultEntityId) " + + "WHERE NEW.[FailureMechanismSectionEntityId] = OLD.[FailureMechanismSectionEntityId] " + + "AND NEW.[SimpleAssessmentResult] = OLD.[SimpleAssessmentResult] " + + "AND NEW.[DetailedAssessmentResult] = OLD.[DetailedAssessmentResult] " + + "AND NEW.[TailorMadeAssessmentResult] = OLD.[TailorMadeAssessmentResult] " + + "AND NEW.[TailorMadeAssessmentProbability] IS OLD.[TailorMadeAssessmentProbability] " + + "AND NEW.[UseManualAssembly] = OLD.[UseManualAssembly] " + + "AND NEW.[ManualAssemblyProbability] IS OLD.[ManualAssemblyProbability]; " + + "DETACH SOURCEPROJECT;"; + reader.AssertReturnedDataIsValid(validateSectionResults); + } + + private static void AssertHeightStructuresCalculation(MigratedDatabaseReader reader, string sourceFilePath) + { + string validateCalculationLinkedToSectionResult = + $"ATTACH DATABASE \"{sourceFilePath}\" AS SOURCEPROJECT; " + + "SELECT COUNT() = " + + "(" + + "SELECT COUNT() " + + "FROM SOURCEPROJECT.HeightStructuresCalculationEntity " + + "JOIN SOURCEPROJECT.HeightStructuresSectionResultEntity USING(HeightStructuresCalculationEntityId) " + + ") " + + "FROM HeightStructuresCalculationEntity NEW " + + "JOIN SOURCEPROJECT.HeightStructuresCalculationEntity OLD USING(HeightStructuresCalculationEntityId) " + + "WHERE NEW.[CalculationGroupEntityId] = OLD.[CalculationGroupEntityId] " + + "AND NEW.[ForeshoreProfileEntityId] IS OLD.[ForeshoreProfileEntityId] " + + "AND NEW.[HydraulicLocationEntityId] IS OLD.[HydraulicLocationEntityId] " + + "AND NEW.[HeightStructureEntityId] IS OLD.[HeightStructureEntityId] " + + "AND NEW.\"Order\" = OLD.\"Order\" " + + "AND NEW.[Name] IS OLD.[Name] " + + "AND NEW.[Comments] IS OLD.[Comments] " + + "AND NEW.[ModelFactorSuperCriticalFlowMean] IS OLD.[ModelFactorSuperCriticalFlowMean] " + + "AND NEW.[StructureNormalOrientation] IS OLD.[StructureNormalOrientation] " + + "AND NEW.[AllowedLevelIncreaseStorageMean] IS OLD.[AllowedLevelIncreaseStorageMean] " + + "AND NEW.[AllowedLevelIncreaseStorageStandardDeviation] IS OLD.[AllowedLevelIncreaseStorageStandardDeviation] " + + "AND NEW.[StorageStructureAreaMean] IS OLD.[StorageStructureAreaMean] " + + "AND NEW.[StorageStructureAreaCoefficientOfVariation] IS OLD.[StorageStructureAreaCoefficientOfVariation] " + + "AND NEW.[FlowWidthAtBottomProtectionMean] IS OLD.[FlowWidthAtBottomProtectionMean] " + + "AND NEW.[FlowWidthAtBottomProtectionStandardDeviation] IS OLD.[FlowWidthAtBottomProtectionStandardDeviation] " + + "AND NEW.[CriticalOvertoppingDischargeMean] IS OLD.[CriticalOvertoppingDischargeMean] " + + "AND NEW.[CriticalOvertoppingDischargeCoefficientOfVariation] IS OLD.[CriticalOvertoppingDischargeCoefficientOfVariation] " + + "AND NEW.[FailureProbabilityStructureWithErosion] IS OLD.[FailureProbabilityStructureWithErosion] " + + "AND NEW.[WidthFlowAperturesMean] IS OLD.[WidthFlowAperturesMean] " + + "AND NEW.[WidthFlowAperturesStandardDeviation] IS OLD.[WidthFlowAperturesStandardDeviation] " + + "AND NEW.[StormDurationMean] IS OLD.[StormDurationMean] " + + "AND NEW.[LevelCrestStructureMean] IS OLD.[LevelCrestStructureMean] " + + "AND NEW.[LevelCrestStructureStandardDeviation] IS OLD.[LevelCrestStructureStandardDeviation] " + + "AND NEW.[DeviationWaveDirection] IS OLD.[DeviationWaveDirection] " + + "AND NEW.[UseBreakWater] = OLD.[UseBreakWater] " + + "AND NEW.[UseForeshore] = OLD.[UseForeshore] " + + "AND NEW.[BreakWaterType] IS OLD.[BreakWaterType] " + + "AND NEW.[BreakWaterHeight] IS OLD.[BreakWaterHeight] " + + "AND NEW.[ShouldIllustrationPointsBeCalculated] = OLD.[ShouldIllustrationPointsBeCalculated] " + + "AND NEW.[RelevantForScenario] = 1 " + + "AND NEW.[ScenarioContribution] = 1; " + + "DETACH SOURCEPROJECT;"; + reader.AssertReturnedDataIsValid(validateCalculationLinkedToSectionResult); + + string validateCalculationNotLinkedToSectionResult = + $"ATTACH DATABASE \"{sourceFilePath}\" AS SOURCEPROJECT; " + + "SELECT COUNT() = " + + "(" + + "SELECT COUNT() " + + "FROM SOURCEPROJECT.HeightStructuresCalculationEntity " + + "LEFT JOIN SOURCEPROJECT.HeightStructuresSectionResultEntity " + + "USING(HeightStructuresCalculationEntityId) " + + "WHERE HeightStructuresSectionResultEntityId IS NULL" + + ") " + + "FROM HeightStructuresCalculationEntity NEW " + + "JOIN SOURCEPROJECT.HeightStructuresCalculationEntity OLD USING(HeightStructuresCalculationEntityId) " + + "WHERE NEW.[CalculationGroupEntityId] = OLD.[CalculationGroupEntityId] " + + "AND NEW.[ForeshoreProfileEntityId] IS OLD.[ForeshoreProfileEntityId] " + + "AND NEW.[HydraulicLocationEntityId] IS OLD.[HydraulicLocationEntityId] " + + "AND NEW.[HeightStructureEntityId] IS OLD.[HeightStructureEntityId] " + + "AND NEW.\"Order\" = OLD.\"Order\" " + + "AND NEW.[Name] IS OLD.[Name] " + + "AND NEW.[Comments] IS OLD.[Comments] " + + "AND NEW.[ModelFactorSuperCriticalFlowMean] IS OLD.[ModelFactorSuperCriticalFlowMean] " + + "AND NEW.[StructureNormalOrientation] IS OLD.[StructureNormalOrientation] " + + "AND NEW.[AllowedLevelIncreaseStorageMean] IS OLD.[AllowedLevelIncreaseStorageMean] " + + "AND NEW.[AllowedLevelIncreaseStorageStandardDeviation] IS OLD.[AllowedLevelIncreaseStorageStandardDeviation] " + + "AND NEW.[StorageStructureAreaMean] IS OLD.[StorageStructureAreaMean] " + + "AND NEW.[StorageStructureAreaCoefficientOfVariation] IS OLD.[StorageStructureAreaCoefficientOfVariation] " + + "AND NEW.[FlowWidthAtBottomProtectionMean] IS OLD.[FlowWidthAtBottomProtectionMean] " + + "AND NEW.[FlowWidthAtBottomProtectionStandardDeviation] IS OLD.[FlowWidthAtBottomProtectionStandardDeviation] " + + "AND NEW.[CriticalOvertoppingDischargeMean] IS OLD.[CriticalOvertoppingDischargeMean] " + + "AND NEW.[CriticalOvertoppingDischargeCoefficientOfVariation] IS OLD.[CriticalOvertoppingDischargeCoefficientOfVariation] " + + "AND NEW.[FailureProbabilityStructureWithErosion] IS OLD.[FailureProbabilityStructureWithErosion] " + + "AND NEW.[WidthFlowAperturesMean] IS OLD.[WidthFlowAperturesMean] " + + "AND NEW.[WidthFlowAperturesStandardDeviation] IS OLD.[WidthFlowAperturesStandardDeviation] " + + "AND NEW.[StormDurationMean] IS OLD.[StormDurationMean] " + + "AND NEW.[LevelCrestStructureMean] IS OLD.[LevelCrestStructureMean] " + + "AND NEW.[LevelCrestStructureStandardDeviation] IS OLD.[LevelCrestStructureStandardDeviation] " + + "AND NEW.[DeviationWaveDirection] IS OLD.[DeviationWaveDirection] " + + "AND NEW.[UseBreakWater] = OLD.[UseBreakWater] " + + "AND NEW.[UseForeshore] = OLD.[UseForeshore] " + + "AND NEW.[BreakWaterType] IS OLD.[BreakWaterType] " + + "AND NEW.[BreakWaterHeight] IS OLD.[BreakWaterHeight] " + + "AND NEW.[ShouldIllustrationPointsBeCalculated] = OLD.[ShouldIllustrationPointsBeCalculated] " + + "AND NEW.[RelevantForScenario] = 0 " + + "AND NEW.[ScenarioContribution] = 0; " + + "DETACH SOURCEPROJECT;"; + reader.AssertReturnedDataIsValid(validateCalculationNotLinkedToSectionResult); + } + + private static void AssertHeightStructuresOutput(MigratedDatabaseReader reader) + { + const string validateOutput = + "SELECT COUNT() = 0 " + + "FROM [HeightStructuresOutputEntity]; "; + reader.AssertReturnedDataIsValid(validateOutput); + } + + private static void AssertHeightStructuresSectionResult(MigratedDatabaseReader reader, string sourceFilePath) + { + string validateSectionResults = + $"ATTACH DATABASE \"{sourceFilePath}\" AS SOURCEPROJECT; " + + "SELECT COUNT() = " + + "(" + + "SELECT COUNT() " + + "FROM SOURCEPROJECT.HeightStructuresSectionResultEntity" + + ") " + + "FROM HeightStructuresSectionResultEntity NEW " + + "JOIN SOURCEPROJECT.HeightStructuresSectionResultEntity OLD USING(HeightStructuresSectionResultEntityId) " + + "WHERE NEW.[FailureMechanismSectionEntityId] = OLD.[FailureMechanismSectionEntityId] " + + "AND NEW.[SimpleAssessmentResult] = OLD.[SimpleAssessmentResult] " + + "AND NEW.[DetailedAssessmentResult] = OLD.[DetailedAssessmentResult] " + + "AND NEW.[TailorMadeAssessmentResult] = OLD.[TailorMadeAssessmentResult] " + + "AND NEW.[TailorMadeAssessmentProbability] IS OLD.[TailorMadeAssessmentProbability] " + + "AND NEW.[UseManualAssembly] = OLD.[UseManualAssembly] " + + "AND NEW.[ManualAssemblyProbability] IS OLD.[ManualAssemblyProbability]; " + + "DETACH SOURCEPROJECT;"; + reader.AssertReturnedDataIsValid(validateSectionResults); + } + + private static void AssertStabilityPointStructuresCalculation(MigratedDatabaseReader reader, string sourceFilePath) + { + string validateCalculationLinkedToSectionResult = + $"ATTACH DATABASE \"{sourceFilePath}\" AS SOURCEPROJECT; " + + "SELECT COUNT() = " + + "(" + + "SELECT COUNT() " + + "FROM SOURCEPROJECT.StabilityPointStructuresCalculationEntity " + + "JOIN SOURCEPROJECT.StabilityPointStructuresSectionResultEntity USING(StabilityPointStructuresCalculationEntityId) " + + ") " + + "FROM StabilityPointStructuresCalculationEntity NEW " + + "JOIN SOURCEPROJECT.StabilityPointStructuresCalculationEntity OLD USING(StabilityPointStructuresCalculationEntityId) " + + "WHERE NEW.[CalculationGroupEntityId] = OLD.[CalculationGroupEntityId] " + + "AND NEW.[ForeshoreProfileEntityId] IS OLD.[ForeshoreProfileEntityId] " + + "AND NEW.[HydraulicLocationEntityId] IS OLD.[HydraulicLocationEntityId] " + + "AND NEW.[StabilityPointStructureEntityId] IS OLD.[StabilityPointStructureEntityId] " + + "AND NEW.\"Order\" = OLD.\"Order\" " + + "AND NEW.[Name] IS OLD.[Name] " + + "AND NEW.[Comments] IS OLD.[Comments] " + + "AND NEW.[UseBreakWater] = OLD.[UseBreakWater] " + + "AND NEW.[UseForeshore] = OLD.[UseForeshore] " + + "AND NEW.[BreakWaterType] IS OLD.[BreakWaterType] " + + "AND NEW.[BreakWaterHeight] IS OLD.[BreakWaterHeight] " + + "AND NEW.[StructureNormalOrientation] IS OLD.[StructureNormalOrientation] " + + "AND NEW.[StorageStructureAreaMean] IS OLD.[StorageStructureAreaMean] " + + "AND NEW.[StorageStructureAreaCoefficientOfVariation] IS OLD.[StorageStructureAreaCoefficientOfVariation] " + + "AND NEW.[AllowedLevelIncreaseStorageMean] IS OLD.[AllowedLevelIncreaseStorageMean] " + + "AND NEW.[AllowedLevelIncreaseStorageStandardDeviation] IS OLD.[AllowedLevelIncreaseStorageStandardDeviation] " + + "AND NEW.[WidthFlowAperturesMean] IS OLD.[WidthFlowAperturesMean] " + + "AND NEW.[WidthFlowAperturesStandardDeviation] IS OLD.[WidthFlowAperturesStandardDeviation] " + + "AND NEW.[InsideWaterLevelMean] IS OLD.[InsideWaterLevelMean] " + + "AND NEW.[InsideWaterLevelStandardDeviation] IS OLD.[InsideWaterLevelStandardDeviation] " + + "AND NEW.[ThresholdHeightOpenWeirMean] IS OLD.[ThresholdHeightOpenWeirMean] " + + "AND NEW.[ThresholdHeightOpenWeirStandardDeviation] IS OLD.[ThresholdHeightOpenWeirStandardDeviation] " + + "AND NEW.[CriticalOvertoppingDischargeMean] IS OLD.[CriticalOvertoppingDischargeMean] " + + "AND NEW.[CriticalOvertoppingDischargeCoefficientOfVariation] IS OLD.[CriticalOvertoppingDischargeCoefficientOfVariation] " + + "AND NEW.[FlowWidthAtBottomProtectionMean] IS OLD.[FlowWidthAtBottomProtectionMean] " + + "AND NEW.[FlowWidthAtBottomProtectionStandardDeviation] IS OLD.[FlowWidthAtBottomProtectionStandardDeviation] " + + "AND NEW.[ConstructiveStrengthLinearLoadModelMean] IS OLD.[ConstructiveStrengthLinearLoadModelMean] " + + "AND NEW.[ConstructiveStrengthLinearLoadModelCoefficientOfVariation] IS OLD.[ConstructiveStrengthLinearLoadModelCoefficientOfVariation] " + + "AND NEW.[ConstructiveStrengthQuadraticLoadModelMean] IS OLD.[ConstructiveStrengthQuadraticLoadModelMean] " + + "AND NEW.[ConstructiveStrengthQuadraticLoadModelCoefficientOfVariation] IS OLD.[ConstructiveStrengthQuadraticLoadModelCoefficientOfVariation] " + + "AND NEW.[BankWidthMean] IS OLD.[BankWidthMean] " + + "AND NEW.[BankWidthStandardDeviation] IS OLD.[BankWidthStandardDeviation] " + + "AND NEW.[InsideWaterLevelFailureConstructionMean] IS OLD.[InsideWaterLevelFailureConstructionMean] " + + "AND NEW.[InsideWaterLevelFailureConstructionStandardDeviation] IS OLD.[InsideWaterLevelFailureConstructionStandardDeviation] " + + "AND NEW.[EvaluationLevel] IS OLD.[EvaluationLevel] " + + "AND NEW.[LevelCrestStructureMean] IS OLD.[LevelCrestStructureMean] " + + "AND NEW.[LevelCrestStructureStandardDeviation] IS OLD.[LevelCrestStructureStandardDeviation] " + + "AND NEW.[VerticalDistance] IS OLD.[VerticalDistance] " + + "AND NEW.[FailureProbabilityRepairClosure] = OLD.[FailureProbabilityRepairClosure] " + + "AND NEW.[FailureCollisionEnergyMean] IS OLD.[FailureCollisionEnergyMean] " + + "AND NEW.[FailureCollisionEnergyCoefficientOfVariation] IS OLD.[FailureCollisionEnergyCoefficientOfVariation] " + + "AND NEW.[ShipMassMean] IS OLD.[ShipMassMean] " + + "AND NEW.[ShipMassCoefficientOfVariation] IS OLD.[ShipMassCoefficientOfVariation] " + + "AND NEW.[ShipVelocityMean] IS OLD.[ShipVelocityMean] " + + "AND NEW.[ShipVelocityCoefficientOfVariation] IS OLD.[ShipVelocityCoefficientOfVariation] " + + "AND NEW.[LevellingCount] = OLD.[LevellingCount] " + + "AND NEW.[ProbabilityCollisionSecondaryStructure] = OLD.[ProbabilityCollisionSecondaryStructure] " + + "AND NEW.[FlowVelocityStructureClosableMean] IS OLD.[FlowVelocityStructureClosableMean] " + + "AND NEW.[StabilityLinearLoadModelMean] IS OLD.[StabilityLinearLoadModelMean] " + + "AND NEW.[StabilityLinearLoadModelCoefficientOfVariation] IS OLD.[StabilityLinearLoadModelCoefficientOfVariation] " + + "AND NEW.[StabilityQuadraticLoadModelMean] IS OLD.[StabilityQuadraticLoadModelMean] " + + "AND NEW.[StabilityQuadraticLoadModelCoefficientOfVariation] IS OLD.[StabilityQuadraticLoadModelCoefficientOfVariation] " + + "AND NEW.[AreaFlowAperturesMean] IS OLD.[AreaFlowAperturesMean] " + + "AND NEW.[AreaFlowAperturesStandardDeviation] IS OLD.[AreaFlowAperturesStandardDeviation] " + + "AND NEW.[InflowModelType] = OLD.[InflowModelType] " + + "AND NEW.[LoadSchematizationType] = OLD.[LoadSchematizationType] " + + "AND NEW.[VolumicWeightWater] IS OLD.[VolumicWeightWater] " + + "AND NEW.[StormDurationMean] IS OLD.[StormDurationMean] " + + "AND NEW.[FactorStormDurationOpenStructure] IS OLD.[FactorStormDurationOpenStructure] " + + "AND NEW.[DrainCoefficientMean] IS OLD.[DrainCoefficientMean] " + + "AND NEW.[DrainCoefficientStandardDeviation] IS 0.2 " + + "AND NEW.[FailureProbabilityStructureWithErosion] IS OLD.[FailureProbabilityStructureWithErosion] " + + "AND NEW.[ShouldIllustrationPointsBeCalculated] = OLD.[ShouldIllustrationPointsBeCalculated] " + + "AND NEW.[RelevantForScenario] = 1 " + + "AND NEW.[ScenarioContribution] = 1; " + + "DETACH SOURCEPROJECT;"; + reader.AssertReturnedDataIsValid(validateCalculationLinkedToSectionResult); + + string validateCalculationNotLinkedToSectionResult = + $"ATTACH DATABASE \"{sourceFilePath}\" AS SOURCEPROJECT; " + + "SELECT COUNT() = " + + "(" + + "SELECT COUNT() " + + "FROM SOURCEPROJECT.StabilityPointStructuresCalculationEntity " + + "LEFT JOIN SOURCEPROJECT.StabilityPointStructuresSectionResultEntity " + + "USING(StabilityPointStructuresCalculationEntityId) " + + "WHERE StabilityPointStructuresSectionResultEntityId IS NULL" + + ") " + + "FROM StabilityPointStructuresCalculationEntity NEW " + + "JOIN SOURCEPROJECT.StabilityPointStructuresCalculationEntity OLD USING(StabilityPointStructuresCalculationEntityId) " + + "WHERE NEW.[CalculationGroupEntityId] = OLD.[CalculationGroupEntityId] " + + "AND NEW.[ForeshoreProfileEntityId] IS OLD.[ForeshoreProfileEntityId] " + + "AND NEW.[HydraulicLocationEntityId] IS OLD.[HydraulicLocationEntityId] " + + "AND NEW.[StabilityPointStructureEntityId] IS OLD.[StabilityPointStructureEntityId] " + + "AND NEW.\"Order\" = OLD.\"Order\" " + + "AND NEW.[Name] IS OLD.[Name] " + + "AND NEW.[Comments] IS OLD.[Comments] " + + "AND NEW.[UseBreakWater] = OLD.[UseBreakWater] " + + "AND NEW.[UseForeshore] = OLD.[UseForeshore] " + + "AND NEW.[BreakWaterType] IS OLD.[BreakWaterType] " + + "AND NEW.[BreakWaterHeight] IS OLD.[BreakWaterHeight] " + + "AND NEW.[StructureNormalOrientation] IS OLD.[StructureNormalOrientation] " + + "AND NEW.[StorageStructureAreaMean] IS OLD.[StorageStructureAreaMean] " + + "AND NEW.[StorageStructureAreaCoefficientOfVariation] IS OLD.[StorageStructureAreaCoefficientOfVariation] " + + "AND NEW.[AllowedLevelIncreaseStorageMean] IS OLD.[AllowedLevelIncreaseStorageMean] " + + "AND NEW.[AllowedLevelIncreaseStorageStandardDeviation] IS OLD.[AllowedLevelIncreaseStorageStandardDeviation] " + + "AND NEW.[WidthFlowAperturesMean] IS OLD.[WidthFlowAperturesMean] " + + "AND NEW.[WidthFlowAperturesStandardDeviation] IS OLD.[WidthFlowAperturesStandardDeviation] " + + "AND NEW.[InsideWaterLevelMean] IS OLD.[InsideWaterLevelMean] " + + "AND NEW.[InsideWaterLevelStandardDeviation] IS OLD.[InsideWaterLevelStandardDeviation] " + + "AND NEW.[ThresholdHeightOpenWeirMean] IS OLD.[ThresholdHeightOpenWeirMean] " + + "AND NEW.[ThresholdHeightOpenWeirStandardDeviation] IS OLD.[ThresholdHeightOpenWeirStandardDeviation] " + + "AND NEW.[CriticalOvertoppingDischargeMean] IS OLD.[CriticalOvertoppingDischargeMean] " + + "AND NEW.[CriticalOvertoppingDischargeCoefficientOfVariation] IS OLD.[CriticalOvertoppingDischargeCoefficientOfVariation] " + + "AND NEW.[FlowWidthAtBottomProtectionMean] IS OLD.[FlowWidthAtBottomProtectionMean] " + + "AND NEW.[FlowWidthAtBottomProtectionStandardDeviation] IS OLD.[FlowWidthAtBottomProtectionStandardDeviation] " + + "AND NEW.[ConstructiveStrengthLinearLoadModelMean] IS OLD.[ConstructiveStrengthLinearLoadModelMean] " + + "AND NEW.[ConstructiveStrengthLinearLoadModelCoefficientOfVariation] IS OLD.[ConstructiveStrengthLinearLoadModelCoefficientOfVariation] " + + "AND NEW.[ConstructiveStrengthQuadraticLoadModelMean] IS OLD.[ConstructiveStrengthQuadraticLoadModelMean] " + + "AND NEW.[ConstructiveStrengthQuadraticLoadModelCoefficientOfVariation] IS OLD.[ConstructiveStrengthQuadraticLoadModelCoefficientOfVariation] " + + "AND NEW.[BankWidthMean] IS OLD.[BankWidthMean] " + + "AND NEW.[BankWidthStandardDeviation] IS OLD.[BankWidthStandardDeviation] " + + "AND NEW.[InsideWaterLevelFailureConstructionMean] IS OLD.[InsideWaterLevelFailureConstructionMean] " + + "AND NEW.[InsideWaterLevelFailureConstructionStandardDeviation] IS OLD.[InsideWaterLevelFailureConstructionStandardDeviation] " + + "AND NEW.[EvaluationLevel] IS OLD.[EvaluationLevel] " + + "AND NEW.[LevelCrestStructureMean] IS OLD.[LevelCrestStructureMean] " + + "AND NEW.[LevelCrestStructureStandardDeviation] IS OLD.[LevelCrestStructureStandardDeviation] " + + "AND NEW.[VerticalDistance] IS OLD.[VerticalDistance] " + + "AND NEW.[FailureProbabilityRepairClosure] = OLD.[FailureProbabilityRepairClosure] " + + "AND NEW.[FailureCollisionEnergyMean] IS OLD.[FailureCollisionEnergyMean] " + + "AND NEW.[FailureCollisionEnergyCoefficientOfVariation] IS OLD.[FailureCollisionEnergyCoefficientOfVariation] " + + "AND NEW.[ShipMassMean] IS OLD.[ShipMassMean] " + + "AND NEW.[ShipMassCoefficientOfVariation] IS OLD.[ShipMassCoefficientOfVariation] " + + "AND NEW.[ShipVelocityMean] IS OLD.[ShipVelocityMean] " + + "AND NEW.[ShipVelocityCoefficientOfVariation] IS OLD.[ShipVelocityCoefficientOfVariation] " + + "AND NEW.[LevellingCount] = OLD.[LevellingCount] " + + "AND NEW.[ProbabilityCollisionSecondaryStructure] = OLD.[ProbabilityCollisionSecondaryStructure] " + + "AND NEW.[FlowVelocityStructureClosableMean] IS OLD.[FlowVelocityStructureClosableMean] " + + "AND NEW.[StabilityLinearLoadModelMean] IS OLD.[StabilityLinearLoadModelMean] " + + "AND NEW.[StabilityLinearLoadModelCoefficientOfVariation] IS OLD.[StabilityLinearLoadModelCoefficientOfVariation] " + + "AND NEW.[StabilityQuadraticLoadModelMean] IS OLD.[StabilityQuadraticLoadModelMean] " + + "AND NEW.[StabilityQuadraticLoadModelCoefficientOfVariation] IS OLD.[StabilityQuadraticLoadModelCoefficientOfVariation] " + + "AND NEW.[AreaFlowAperturesMean] IS OLD.[AreaFlowAperturesMean] " + + "AND NEW.[AreaFlowAperturesStandardDeviation] IS OLD.[AreaFlowAperturesStandardDeviation] " + + "AND NEW.[InflowModelType] = OLD.[InflowModelType] " + + "AND NEW.[LoadSchematizationType] = OLD.[LoadSchematizationType] " + + "AND NEW.[VolumicWeightWater] IS OLD.[VolumicWeightWater] " + + "AND NEW.[StormDurationMean] IS OLD.[StormDurationMean] " + + "AND NEW.[FactorStormDurationOpenStructure] IS OLD.[FactorStormDurationOpenStructure] " + + "AND NEW.[DrainCoefficientMean] IS OLD.[DrainCoefficientMean] " + + "AND NEW.[DrainCoefficientStandardDeviation] IS 0.2 " + + "AND NEW.[FailureProbabilityStructureWithErosion] IS OLD.[FailureProbabilityStructureWithErosion] " + + "AND NEW.[ShouldIllustrationPointsBeCalculated] = OLD.[ShouldIllustrationPointsBeCalculated] " + + "AND NEW.[RelevantForScenario] = 0 " + + "AND NEW.[ScenarioContribution] = 0; " + + "DETACH SOURCEPROJECT;"; + reader.AssertReturnedDataIsValid(validateCalculationNotLinkedToSectionResult); + } + + private static void AssertStabilityPointStructuresOutput(MigratedDatabaseReader reader) + { + const string validateOutput = + "SELECT COUNT() = 0 " + + "FROM [StabilityPointStructuresOutputEntity]; "; + reader.AssertReturnedDataIsValid(validateOutput); + } + + private static void AssertStabilityPointStructuresSectionResult(MigratedDatabaseReader reader, string sourceFilePath) + { + string validateSectionResults = + $"ATTACH DATABASE \"{sourceFilePath}\" AS SOURCEPROJECT; " + + "SELECT COUNT() = " + + "(" + + "SELECT COUNT() " + + "FROM SOURCEPROJECT.StabilityPointStructuresSectionResultEntity" + + ") " + + "FROM StabilityPointStructuresSectionResultEntity NEW " + + "JOIN SOURCEPROJECT.StabilityPointStructuresSectionResultEntity OLD USING(StabilityPointStructuresSectionResultEntityId) " + + "WHERE NEW.[FailureMechanismSectionEntityId] = OLD.[FailureMechanismSectionEntityId] " + + "AND NEW.[SimpleAssessmentResult] = OLD.[SimpleAssessmentResult] " + + "AND NEW.[DetailedAssessmentResult] = OLD.[DetailedAssessmentResult] " + + "AND NEW.[TailorMadeAssessmentResult] = OLD.[TailorMadeAssessmentResult] " + + "AND NEW.[TailorMadeAssessmentProbability] IS OLD.[TailorMadeAssessmentProbability] " + + "AND NEW.[UseManualAssembly] = OLD.[UseManualAssembly] " + + "AND NEW.[ManualAssemblyProbability] IS OLD.[ManualAssemblyProbability]; " + + "DETACH SOURCEPROJECT;"; + reader.AssertReturnedDataIsValid(validateSectionResults); + } + + private static void AssertMacroStabilityInwardsCalculation(MigratedDatabaseReader reader, string sourceFilePath) + { + string validateCalculationWithScenarioContributionNullOrBelowZero = + $"ATTACH DATABASE \"{sourceFilePath}\" AS SOURCEPROJECT; " + + "SELECT COUNT() = " + + "(" + + "SELECT COUNT() " + + "FROM [SOURCEPROJECT].MacroStabilityInwardsCalculationEntity " + + "WHERE ScenarioContribution IS NULL " + + "OR ScenarioContribution <= 0 " + + ")" + + "FROM MacroStabilityInwardsCalculationEntity NEW " + + "JOIN [SOURCEPROJECT].MacroStabilityInwardsCalculationEntity OLD USING(MacroStabilityInwardsCalculationEntityId) " + + "WHERE NEW.[MacroStabilityInwardsCalculationEntityId] = OLD.[MacroStabilityInwardsCalculationEntityId] " + + "AND NEW.[CalculationGroupEntityId] = OLD.[CalculationGroupEntityId] " + + "AND NEW.[SurfaceLineEntityId] IS OLD.[SurfaceLineEntityId] " + + "AND NEW.[MacroStabilityInwardsStochasticSoilProfileEntityId] IS OLD.[MacroStabilityInwardsStochasticSoilProfileEntityId] " + + "AND NEW.[HydraulicLocationEntityId] IS OLD.[HydraulicLocationEntityId] " + + "AND NEW.[Order] = OLD.[Order] " + + "AND NEW.[Name] IS OLD.[Name] " + + "AND NEW.[Comment] IS OLD.[Comment] " + + "AND NEW.[RelevantForScenario] = OLD.[RelevantForScenario] " + + "AND NEW.[ScenarioContribution] = 0 " + + "AND NEW.[AssessmentLevel] IS OLD.[AssessmentLevel] " + + "AND NEW.[UseAssessmentLevelManualInput] = OLD.[UseAssessmentLevelManualInput] " + + "AND NEW.[SlipPlaneMinimumDepth] IS OLD.[SlipPlaneMinimumDepth] " + + "AND NEW.[SlipPlaneMinimumLength] IS OLD.[SlipPlaneMinimumLength] " + + "AND NEW.[MaximumSliceWidth] IS OLD.[MaximumSliceWidth] " + + "AND NEW.[MoveGrid] = OLD.[MoveGrid] " + + "AND NEW.[GridDeterminationType] = OLD.[GridDeterminationType] " + + "AND NEW.[TangentLineDeterminationType] = OLD.[TangentLineDeterminationType] " + + "AND NEW.[TangentLineZTop] IS OLD.[TangentLineZTop] " + + "AND NEW.[TangentLineZBottom] IS OLD.[TangentLineZBottom] " + + "AND NEW.[TangentLineNumber] = OLD.[TangentLineNumber] " + + "AND NEW.[LeftGridXLeft] IS OLD.[LeftGridXLeft] " + + "AND NEW.[LeftGridXRight] IS OLD.[LeftGridXRight] " + + "AND NEW.[LeftGridNrOfHorizontalPoints] = OLD.[LeftGridNrOfHorizontalPoints] " + + "AND NEW.[LeftGridZTop] IS OLD.[LeftGridZTop] " + + "AND NEW.[LeftGridZBottom] IS OLD.[LeftGridZBottom] " + + "AND NEW.[LeftGridNrOfVerticalPoints] = OLD.[LeftGridNrOfVerticalPoints] " + + "AND NEW.[RightGridXLeft] IS OLD.[RightGridXLeft] " + + "AND NEW.[RightGridXRight] IS OLD.[RightGridXRight] " + + "AND NEW.[RightGridNrOfHorizontalPoints] = OLD.[RightGridNrOfHorizontalPoints] " + + "AND NEW.[RightGridZTop] IS OLD.[RightGridZTop] " + + "AND NEW.[RightGridZBottom] IS OLD.[RightGridZBottom] " + + "AND NEW.[RightGridNrOfVerticalPoints] = OLD.[RightGridNrOfVerticalPoints] " + + "AND NEW.[DikeSoilScenario] = OLD.[DikeSoilScenario] " + + "AND NEW.[WaterLevelRiverAverage] IS OLD.[WaterLevelRiverAverage] " + + "AND NEW.[DrainageConstructionPresent] = OLD.[DrainageConstructionPresent] " + + "AND NEW.[DrainageConstructionCoordinateX] IS OLD.[DrainageConstructionCoordinateX] " + + "AND NEW.[DrainageConstructionCoordinateZ] IS OLD.[DrainageConstructionCoordinateZ] " + + "AND NEW.[MinimumLevelPhreaticLineAtDikeTopRiver] IS OLD.[MinimumLevelPhreaticLineAtDikeTopRiver] " + + "AND NEW.[MinimumLevelPhreaticLineAtDikeTopPolder] IS OLD.[MinimumLevelPhreaticLineAtDikeTopPolder] " + + "AND NEW.[AdjustPhreaticLine3And4ForUplift] = OLD.[AdjustPhreaticLine3And4ForUplift] " + + "AND NEW.[LeakageLengthOutwardsPhreaticLine3] IS OLD.[LeakageLengthOutwardsPhreaticLine3] " + + "AND NEW.[LeakageLengthInwardsPhreaticLine3] IS OLD.[LeakageLengthInwardsPhreaticLine3] " + + "AND NEW.[LeakageLengthOutwardsPhreaticLine4] IS OLD.[LeakageLengthOutwardsPhreaticLine4] " + + "AND NEW.[LeakageLengthInwardsPhreaticLine4] IS OLD.[LeakageLengthInwardsPhreaticLine4] " + + "AND NEW.[PiezometricHeadPhreaticLine2Outwards] IS OLD.[PiezometricHeadPhreaticLine2Outwards] " + + "AND NEW.[PiezometricHeadPhreaticLine2Inwards] IS OLD.[PiezometricHeadPhreaticLine2Inwards] " + + "AND NEW.[LocationInputExtremeWaterLevelPolder] IS OLD.[LocationInputExtremeWaterLevelPolder] " + + "AND NEW.[LocationInputExtremeUseDefaultOffsets] = OLD.[LocationInputExtremeUseDefaultOffsets] " + + "AND NEW.[LocationInputExtremePhreaticLineOffsetBelowDikeTopAtRiver] IS OLD.[LocationInputExtremePhreaticLineOffsetBelowDikeTopAtRiver] " + + "AND NEW.[LocationInputExtremePhreaticLineOffsetBelowDikeTopAtPolder] IS OLD.[LocationInputExtremePhreaticLineOffsetBelowDikeTopAtPolder] " + + "AND NEW.[LocationInputExtremePhreaticLineOffsetBelowShoulderBaseInside] IS OLD.[LocationInputExtremePhreaticLineOffsetBelowShoulderBaseInside] " + + "AND NEW.[LocationInputExtremePhreaticLineOffsetDikeToeAtPolder] IS OLD.[LocationInputExtremePhreaticLineOffsetDikeToeAtPolder] " + + "AND NEW.[LocationInputExtremePenetrationLength] IS OLD.[LocationInputExtremePenetrationLength] " + + "AND NEW.[LocationInputDailyWaterLevelPolder] IS OLD.[LocationInputDailyWaterLevelPolder] " + + "AND NEW.[LocationInputDailyUseDefaultOffsets] = OLD.[LocationInputDailyUseDefaultOffsets] " + + "AND NEW.[LocationInputDailyPhreaticLineOffsetBelowDikeTopAtRiver] IS OLD.[LocationInputDailyPhreaticLineOffsetBelowDikeTopAtRiver] " + + "AND NEW.[LocationInputDailyPhreaticLineOffsetBelowDikeTopAtPolder] IS OLD.[LocationInputDailyPhreaticLineOffsetBelowDikeTopAtPolder] " + + "AND NEW.[LocationInputDailyPhreaticLineOffsetBelowShoulderBaseInside] IS OLD.[LocationInputDailyPhreaticLineOffsetBelowShoulderBaseInside] " + + "AND NEW.[LocationInputDailyPhreaticLineOffsetDikeToeAtPolder] IS OLD.[LocationInputDailyPhreaticLineOffsetDikeToeAtPolder] " + + "AND NEW.[CreateZones] = OLD.[CreateZones] " + + "AND NEW.[ZoningBoundariesDeterminationType] = OLD.[ZoningBoundariesDeterminationType] " + + "AND NEW.[ZoneBoundaryLeft] IS OLD.[ZoneBoundaryLeft] " + + "AND NEW.[ZoneBoundaryRight] IS OLD.[ZoneBoundaryRight]; " + + "DETACH SOURCEPROJECT;"; + reader.AssertReturnedDataIsValid(validateCalculationWithScenarioContributionNullOrBelowZero); + + string validateCalculationWithScenarioContributionAboveOne = + $"ATTACH DATABASE \"{sourceFilePath}\" AS SOURCEPROJECT; " + + "SELECT COUNT() = " + + "(" + + "SELECT COUNT() " + + "FROM [SOURCEPROJECT].MacroStabilityInwardsCalculationEntity " + + "WHERE ScenarioContribution >= 1 " + + ")" + + "FROM MacroStabilityInwardsCalculationEntity NEW " + + "JOIN [SOURCEPROJECT].MacroStabilityInwardsCalculationEntity OLD USING(MacroStabilityInwardsCalculationEntityId) " + + "WHERE NEW.[MacroStabilityInwardsCalculationEntityId] = OLD.[MacroStabilityInwardsCalculationEntityId] " + + "AND NEW.[CalculationGroupEntityId] = OLD.[CalculationGroupEntityId] " + + "AND NEW.[SurfaceLineEntityId] IS OLD.[SurfaceLineEntityId] " + + "AND NEW.[MacroStabilityInwardsStochasticSoilProfileEntityId] IS OLD.[MacroStabilityInwardsStochasticSoilProfileEntityId] " + + "AND NEW.[HydraulicLocationEntityId] IS OLD.[HydraulicLocationEntityId] " + + "AND NEW.[Order] = OLD.[Order] " + + "AND NEW.[Name] IS OLD.[Name] " + + "AND NEW.[Comment] IS OLD.[Comment] " + + "AND NEW.[RelevantForScenario] = OLD.[RelevantForScenario] " + + "AND NEW.[ScenarioContribution] = 1 " + + "AND NEW.[AssessmentLevel] IS OLD.[AssessmentLevel] " + + "AND NEW.[UseAssessmentLevelManualInput] = OLD.[UseAssessmentLevelManualInput] " + + "AND NEW.[SlipPlaneMinimumDepth] IS OLD.[SlipPlaneMinimumDepth] " + + "AND NEW.[SlipPlaneMinimumLength] IS OLD.[SlipPlaneMinimumLength] " + + "AND NEW.[MaximumSliceWidth] IS OLD.[MaximumSliceWidth] " + + "AND NEW.[MoveGrid] = OLD.[MoveGrid] " + + "AND NEW.[GridDeterminationType] = OLD.[GridDeterminationType] " + + "AND NEW.[TangentLineDeterminationType] = OLD.[TangentLineDeterminationType] " + + "AND NEW.[TangentLineZTop] IS OLD.[TangentLineZTop] " + + "AND NEW.[TangentLineZBottom] IS OLD.[TangentLineZBottom] " + + "AND NEW.[TangentLineNumber] = OLD.[TangentLineNumber] " + + "AND NEW.[LeftGridXLeft] IS OLD.[LeftGridXLeft] " + + "AND NEW.[LeftGridXRight] IS OLD.[LeftGridXRight] " + + "AND NEW.[LeftGridNrOfHorizontalPoints] = OLD.[LeftGridNrOfHorizontalPoints] " + + "AND NEW.[LeftGridZTop] IS OLD.[LeftGridZTop] " + + "AND NEW.[LeftGridZBottom] IS OLD.[LeftGridZBottom] " + + "AND NEW.[LeftGridNrOfVerticalPoints] = OLD.[LeftGridNrOfVerticalPoints] " + + "AND NEW.[RightGridXLeft] IS OLD.[RightGridXLeft] " + + "AND NEW.[RightGridXRight] IS OLD.[RightGridXRight] " + + "AND NEW.[RightGridNrOfHorizontalPoints] = OLD.[RightGridNrOfHorizontalPoints] " + + "AND NEW.[RightGridZTop] IS OLD.[RightGridZTop] " + + "AND NEW.[RightGridZBottom] IS OLD.[RightGridZBottom] " + + "AND NEW.[RightGridNrOfVerticalPoints] = OLD.[RightGridNrOfVerticalPoints] " + + "AND NEW.[DikeSoilScenario] = OLD.[DikeSoilScenario] " + + "AND NEW.[WaterLevelRiverAverage] IS OLD.[WaterLevelRiverAverage] " + + "AND NEW.[DrainageConstructionPresent] = OLD.[DrainageConstructionPresent] " + + "AND NEW.[DrainageConstructionCoordinateX] IS OLD.[DrainageConstructionCoordinateX] " + + "AND NEW.[DrainageConstructionCoordinateZ] IS OLD.[DrainageConstructionCoordinateZ] " + + "AND NEW.[MinimumLevelPhreaticLineAtDikeTopRiver] IS OLD.[MinimumLevelPhreaticLineAtDikeTopRiver] " + + "AND NEW.[MinimumLevelPhreaticLineAtDikeTopPolder] IS OLD.[MinimumLevelPhreaticLineAtDikeTopPolder] " + + "AND NEW.[AdjustPhreaticLine3And4ForUplift] = OLD.[AdjustPhreaticLine3And4ForUplift] " + + "AND NEW.[LeakageLengthOutwardsPhreaticLine3] IS OLD.[LeakageLengthOutwardsPhreaticLine3] " + + "AND NEW.[LeakageLengthInwardsPhreaticLine3] IS OLD.[LeakageLengthInwardsPhreaticLine3] " + + "AND NEW.[LeakageLengthOutwardsPhreaticLine4] IS OLD.[LeakageLengthOutwardsPhreaticLine4] " + + "AND NEW.[LeakageLengthInwardsPhreaticLine4] IS OLD.[LeakageLengthInwardsPhreaticLine4] " + + "AND NEW.[PiezometricHeadPhreaticLine2Outwards] IS OLD.[PiezometricHeadPhreaticLine2Outwards] " + + "AND NEW.[PiezometricHeadPhreaticLine2Inwards] IS OLD.[PiezometricHeadPhreaticLine2Inwards] " + + "AND NEW.[LocationInputExtremeWaterLevelPolder] IS OLD.[LocationInputExtremeWaterLevelPolder] " + + "AND NEW.[LocationInputExtremeUseDefaultOffsets] = OLD.[LocationInputExtremeUseDefaultOffsets] " + + "AND NEW.[LocationInputExtremePhreaticLineOffsetBelowDikeTopAtRiver] IS OLD.[LocationInputExtremePhreaticLineOffsetBelowDikeTopAtRiver] " + + "AND NEW.[LocationInputExtremePhreaticLineOffsetBelowDikeTopAtPolder] IS OLD.[LocationInputExtremePhreaticLineOffsetBelowDikeTopAtPolder] " + + "AND NEW.[LocationInputExtremePhreaticLineOffsetBelowShoulderBaseInside] IS OLD.[LocationInputExtremePhreaticLineOffsetBelowShoulderBaseInside] " + + "AND NEW.[LocationInputExtremePhreaticLineOffsetDikeToeAtPolder] IS OLD.[LocationInputExtremePhreaticLineOffsetDikeToeAtPolder] " + + "AND NEW.[LocationInputExtremePenetrationLength] IS OLD.[LocationInputExtremePenetrationLength] " + + "AND NEW.[LocationInputDailyWaterLevelPolder] IS OLD.[LocationInputDailyWaterLevelPolder] " + + "AND NEW.[LocationInputDailyUseDefaultOffsets] = OLD.[LocationInputDailyUseDefaultOffsets] " + + "AND NEW.[LocationInputDailyPhreaticLineOffsetBelowDikeTopAtRiver] IS OLD.[LocationInputDailyPhreaticLineOffsetBelowDikeTopAtRiver] " + + "AND NEW.[LocationInputDailyPhreaticLineOffsetBelowDikeTopAtPolder] IS OLD.[LocationInputDailyPhreaticLineOffsetBelowDikeTopAtPolder] " + + "AND NEW.[LocationInputDailyPhreaticLineOffsetBelowShoulderBaseInside] IS OLD.[LocationInputDailyPhreaticLineOffsetBelowShoulderBaseInside] " + + "AND NEW.[LocationInputDailyPhreaticLineOffsetDikeToeAtPolder] IS OLD.[LocationInputDailyPhreaticLineOffsetDikeToeAtPolder] " + + "AND NEW.[CreateZones] = OLD.[CreateZones] " + + "AND NEW.[ZoningBoundariesDeterminationType] = OLD.[ZoningBoundariesDeterminationType] " + + "AND NEW.[ZoneBoundaryLeft] IS OLD.[ZoneBoundaryLeft] " + + "AND NEW.[ZoneBoundaryRight] IS OLD.[ZoneBoundaryRight]; " + + "DETACH SOURCEPROJECT;"; + reader.AssertReturnedDataIsValid(validateCalculationWithScenarioContributionAboveOne); + + string validateCalculationWithValidScenarioContribution = + $"ATTACH DATABASE \"{sourceFilePath}\" AS SOURCEPROJECT; " + + "SELECT COUNT() = " + + "(" + + "SELECT COUNT() " + + "FROM [SOURCEPROJECT].MacroStabilityInwardsCalculationEntity " + + "WHERE ScenarioContribution >= 0 " + + "AND ScenarioContribution <= 1 " + + ")" + + "FROM MacroStabilityInwardsCalculationEntity NEW " + + "JOIN [SOURCEPROJECT].MacroStabilityInwardsCalculationEntity OLD USING(MacroStabilityInwardsCalculationEntityId) " + + "WHERE NEW.[MacroStabilityInwardsCalculationEntityId] = OLD.[MacroStabilityInwardsCalculationEntityId] " + + "AND NEW.[CalculationGroupEntityId] = OLD.[CalculationGroupEntityId] " + + "AND NEW.[SurfaceLineEntityId] IS OLD.[SurfaceLineEntityId] " + + "AND NEW.[MacroStabilityInwardsStochasticSoilProfileEntityId] IS OLD.[MacroStabilityInwardsStochasticSoilProfileEntityId] " + + "AND NEW.[HydraulicLocationEntityId] IS OLD.[HydraulicLocationEntityId] " + + "AND NEW.[Order] = OLD.[Order] " + + "AND NEW.[Name] IS OLD.[Name] " + + "AND NEW.[Comment] IS OLD.[Comment] " + + "AND NEW.[RelevantForScenario] = OLD.[RelevantForScenario] " + + "AND NEW.[ScenarioContribution] = OLD.[ScenarioContribution] " + + "AND NEW.[AssessmentLevel] IS OLD.[AssessmentLevel] " + + "AND NEW.[UseAssessmentLevelManualInput] = OLD.[UseAssessmentLevelManualInput] " + + "AND NEW.[SlipPlaneMinimumDepth] IS OLD.[SlipPlaneMinimumDepth] " + + "AND NEW.[SlipPlaneMinimumLength] IS OLD.[SlipPlaneMinimumLength] " + + "AND NEW.[MaximumSliceWidth] IS OLD.[MaximumSliceWidth] " + + "AND NEW.[MoveGrid] = OLD.[MoveGrid] " + + "AND NEW.[GridDeterminationType] = OLD.[GridDeterminationType] " + + "AND NEW.[TangentLineDeterminationType] = OLD.[TangentLineDeterminationType] " + + "AND NEW.[TangentLineZTop] IS OLD.[TangentLineZTop] " + + "AND NEW.[TangentLineZBottom] IS OLD.[TangentLineZBottom] " + + "AND NEW.[TangentLineNumber] = OLD.[TangentLineNumber] " + + "AND NEW.[LeftGridXLeft] IS OLD.[LeftGridXLeft] " + + "AND NEW.[LeftGridXRight] IS OLD.[LeftGridXRight] " + + "AND NEW.[LeftGridNrOfHorizontalPoints] = OLD.[LeftGridNrOfHorizontalPoints] " + + "AND NEW.[LeftGridZTop] IS OLD.[LeftGridZTop] " + + "AND NEW.[LeftGridZBottom] IS OLD.[LeftGridZBottom] " + + "AND NEW.[LeftGridNrOfVerticalPoints] = OLD.[LeftGridNrOfVerticalPoints] " + + "AND NEW.[RightGridXLeft] IS OLD.[RightGridXLeft] " + + "AND NEW.[RightGridXRight] IS OLD.[RightGridXRight] " + + "AND NEW.[RightGridNrOfHorizontalPoints] = OLD.[RightGridNrOfHorizontalPoints] " + + "AND NEW.[RightGridZTop] IS OLD.[RightGridZTop] " + + "AND NEW.[RightGridZBottom] IS OLD.[RightGridZBottom] " + + "AND NEW.[RightGridNrOfVerticalPoints] = OLD.[RightGridNrOfVerticalPoints] " + + "AND NEW.[DikeSoilScenario] = OLD.[DikeSoilScenario] " + + "AND NEW.[WaterLevelRiverAverage] IS OLD.[WaterLevelRiverAverage] " + + "AND NEW.[DrainageConstructionPresent] = OLD.[DrainageConstructionPresent] " + + "AND NEW.[DrainageConstructionCoordinateX] IS OLD.[DrainageConstructionCoordinateX] " + + "AND NEW.[DrainageConstructionCoordinateZ] IS OLD.[DrainageConstructionCoordinateZ] " + + "AND NEW.[MinimumLevelPhreaticLineAtDikeTopRiver] IS OLD.[MinimumLevelPhreaticLineAtDikeTopRiver] " + + "AND NEW.[MinimumLevelPhreaticLineAtDikeTopPolder] IS OLD.[MinimumLevelPhreaticLineAtDikeTopPolder] " + + "AND NEW.[AdjustPhreaticLine3And4ForUplift] = OLD.[AdjustPhreaticLine3And4ForUplift] " + + "AND NEW.[LeakageLengthOutwardsPhreaticLine3] IS OLD.[LeakageLengthOutwardsPhreaticLine3] " + + "AND NEW.[LeakageLengthInwardsPhreaticLine3] IS OLD.[LeakageLengthInwardsPhreaticLine3] " + + "AND NEW.[LeakageLengthOutwardsPhreaticLine4] IS OLD.[LeakageLengthOutwardsPhreaticLine4] " + + "AND NEW.[LeakageLengthInwardsPhreaticLine4] IS OLD.[LeakageLengthInwardsPhreaticLine4] " + + "AND NEW.[PiezometricHeadPhreaticLine2Outwards] IS OLD.[PiezometricHeadPhreaticLine2Outwards] " + + "AND NEW.[PiezometricHeadPhreaticLine2Inwards] IS OLD.[PiezometricHeadPhreaticLine2Inwards] " + + "AND NEW.[LocationInputExtremeWaterLevelPolder] IS OLD.[LocationInputExtremeWaterLevelPolder] " + + "AND NEW.[LocationInputExtremeUseDefaultOffsets] = OLD.[LocationInputExtremeUseDefaultOffsets] " + + "AND NEW.[LocationInputExtremePhreaticLineOffsetBelowDikeTopAtRiver] IS OLD.[LocationInputExtremePhreaticLineOffsetBelowDikeTopAtRiver] " + + "AND NEW.[LocationInputExtremePhreaticLineOffsetBelowDikeTopAtPolder] IS OLD.[LocationInputExtremePhreaticLineOffsetBelowDikeTopAtPolder] " + + "AND NEW.[LocationInputExtremePhreaticLineOffsetBelowShoulderBaseInside] IS OLD.[LocationInputExtremePhreaticLineOffsetBelowShoulderBaseInside] " + + "AND NEW.[LocationInputExtremePhreaticLineOffsetDikeToeAtPolder] IS OLD.[LocationInputExtremePhreaticLineOffsetDikeToeAtPolder] " + + "AND NEW.[LocationInputExtremePenetrationLength] IS OLD.[LocationInputExtremePenetrationLength] " + + "AND NEW.[LocationInputDailyWaterLevelPolder] IS OLD.[LocationInputDailyWaterLevelPolder] " + + "AND NEW.[LocationInputDailyUseDefaultOffsets] = OLD.[LocationInputDailyUseDefaultOffsets] " + + "AND NEW.[LocationInputDailyPhreaticLineOffsetBelowDikeTopAtRiver] IS OLD.[LocationInputDailyPhreaticLineOffsetBelowDikeTopAtRiver] " + + "AND NEW.[LocationInputDailyPhreaticLineOffsetBelowDikeTopAtPolder] IS OLD.[LocationInputDailyPhreaticLineOffsetBelowDikeTopAtPolder] " + + "AND NEW.[LocationInputDailyPhreaticLineOffsetBelowShoulderBaseInside] IS OLD.[LocationInputDailyPhreaticLineOffsetBelowShoulderBaseInside] " + + "AND NEW.[LocationInputDailyPhreaticLineOffsetDikeToeAtPolder] IS OLD.[LocationInputDailyPhreaticLineOffsetDikeToeAtPolder] " + + "AND NEW.[CreateZones] = OLD.[CreateZones] " + + "AND NEW.[ZoningBoundariesDeterminationType] = OLD.[ZoningBoundariesDeterminationType] " + + "AND NEW.[ZoneBoundaryLeft] IS OLD.[ZoneBoundaryLeft] " + + "AND NEW.[ZoneBoundaryRight] IS OLD.[ZoneBoundaryRight]; " + + "DETACH SOURCEPROJECT;"; + reader.AssertReturnedDataIsValid(validateCalculationWithValidScenarioContribution); + } + + private static void AssertMacroStabilityInwardsOutput(MigratedDatabaseReader reader) + { + const string macroStabilityInwardsCalculationOutputEntityTable = + "SELECT COUNT() = 0 " + + "FROM MacroStabilityInwardsCalculationOutputEntity;" + + "DETACH SOURCEPROJECT;"; + reader.AssertReturnedDataIsValid(macroStabilityInwardsCalculationOutputEntityTable); + } + + private static void AssertPipingCalculation(MigratedDatabaseReader reader, string sourceFilePath) + { + string validateCalculationWithScenarioContributionNullOrBelowZero = + $"ATTACH DATABASE \"{sourceFilePath}\" AS SOURCEPROJECT; " + + "SELECT COUNT() = " + + "(" + + "SELECT COUNT() " + + "FROM SOURCEPROJECT.PipingCalculationEntity " + + "WHERE ScenarioContribution IS NULL " + + "OR ScenarioContribution <= 0 " + + ") " + + "FROM SemiProbabilisticPipingCalculationEntity NEW " + + "JOIN SOURCEPROJECT.PipingCalculationEntity OLD " + + "ON NEW.[SemiProbabilisticPipingCalculationEntityId] = OLD.[PipingCalculationEntityId]" + + "WHERE NEW.[CalculationGroupEntityId] = OLD.[CalculationGroupEntityId] " + + "AND NEW.[SurfaceLineEntityId] IS OLD.[SurfaceLineEntityId] " + + "AND NEW.[PipingStochasticSoilProfileEntityId] IS OLD.[PipingStochasticSoilProfileEntityId] " + + "AND NEW.[HydraulicLocationEntityId] IS OLD.[HydraulicLocationEntityId] " + + "AND NEW.\"Order\" = OLD.\"Order\" " + + "AND NEW.[Name] IS OLD.[Name] " + + "AND NEW.[Comments] IS OLD.[Comments] " + + "AND NEW.[EntryPointL] IS OLD.[EntryPointL] " + + "AND NEW.[ExitPointL] IS OLD.[ExitPointL] " + + "AND NEW.[PhreaticLevelExitMean] IS OLD.[PhreaticLevelExitMean] " + + "AND NEW.[PhreaticLevelExitStandardDeviation] IS OLD.[PhreaticLevelExitStandardDeviation] " + + "AND NEW.[DampingFactorExitMean] IS OLD.[DampingFactorExitMean] " + + "AND NEW.[DampingFactorExitStandardDeviation] IS OLD.[DampingFactorExitStandardDeviation] " + + "AND NEW.[RelevantForScenario] = OLD.[RelevantForScenario] " + + "AND NEW.[ScenarioContribution] = 0 " + + "AND NEW.[AssessmentLevel] IS OLD.[AssessmentLevel] " + + "AND NEW.[UseAssessmentLevelManualInput] = OLD.[UseAssessmentLevelManualInput]; " + + "DETACH SOURCEPROJECT;"; + reader.AssertReturnedDataIsValid(validateCalculationWithScenarioContributionNullOrBelowZero); + + string validateCalculationWithScenarioContributionAboveOne = + $"ATTACH DATABASE \"{sourceFilePath}\" AS SOURCEPROJECT; " + + "SELECT COUNT() = " + + "(" + + "SELECT COUNT() " + + "FROM SOURCEPROJECT.PipingCalculationEntity " + + "WHERE ScenarioContribution >= 1 " + + ") " + + "FROM SemiProbabilisticPipingCalculationEntity NEW " + + "JOIN SOURCEPROJECT.PipingCalculationEntity OLD " + + "ON NEW.[SemiProbabilisticPipingCalculationEntityId] = OLD.[PipingCalculationEntityId]" + + "WHERE NEW.[CalculationGroupEntityId] = OLD.[CalculationGroupEntityId] " + + "AND NEW.[SurfaceLineEntityId] IS OLD.[SurfaceLineEntityId] " + + "AND NEW.[PipingStochasticSoilProfileEntityId] IS OLD.[PipingStochasticSoilProfileEntityId] " + + "AND NEW.[HydraulicLocationEntityId] IS OLD.[HydraulicLocationEntityId] " + + "AND NEW.\"Order\" = OLD.\"Order\" " + + "AND NEW.[Name] IS OLD.[Name] " + + "AND NEW.[Comments] IS OLD.[Comments] " + + "AND NEW.[EntryPointL] IS OLD.[EntryPointL] " + + "AND NEW.[ExitPointL] IS OLD.[ExitPointL] " + + "AND NEW.[PhreaticLevelExitMean] IS OLD.[PhreaticLevelExitMean] " + + "AND NEW.[PhreaticLevelExitStandardDeviation] IS OLD.[PhreaticLevelExitStandardDeviation] " + + "AND NEW.[DampingFactorExitMean] IS OLD.[DampingFactorExitMean] " + + "AND NEW.[DampingFactorExitStandardDeviation] IS OLD.[DampingFactorExitStandardDeviation] " + + "AND NEW.[RelevantForScenario] = OLD.[RelevantForScenario] " + + "AND NEW.[ScenarioContribution] = 1 " + + "AND NEW.[AssessmentLevel] IS OLD.[AssessmentLevel] " + + "AND NEW.[UseAssessmentLevelManualInput] = OLD.[UseAssessmentLevelManualInput]; " + + "DETACH SOURCEPROJECT;"; + reader.AssertReturnedDataIsValid(validateCalculationWithScenarioContributionAboveOne); + + string validateCalculationWithValidScenarioContribution = + $"ATTACH DATABASE \"{sourceFilePath}\" AS SOURCEPROJECT; " + + "SELECT COUNT() = " + + "(" + + "SELECT COUNT() " + + "FROM SOURCEPROJECT.PipingCalculationEntity " + + "WHERE ScenarioContribution >= 0 " + + "AND ScenarioContribution <= 1 " + + ") " + + "FROM SemiProbabilisticPipingCalculationEntity NEW " + + "JOIN SOURCEPROJECT.PipingCalculationEntity OLD " + + "ON NEW.[SemiProbabilisticPipingCalculationEntityId] = OLD.[PipingCalculationEntityId]" + + "WHERE NEW.[CalculationGroupEntityId] = OLD.[CalculationGroupEntityId] " + + "AND NEW.[SurfaceLineEntityId] IS OLD.[SurfaceLineEntityId] " + + "AND NEW.[PipingStochasticSoilProfileEntityId] IS OLD.[PipingStochasticSoilProfileEntityId] " + + "AND NEW.[HydraulicLocationEntityId] IS OLD.[HydraulicLocationEntityId] " + + "AND NEW.\"Order\" = OLD.\"Order\" " + + "AND NEW.[Name] IS OLD.[Name] " + + "AND NEW.[Comments] IS OLD.[Comments] " + + "AND NEW.[EntryPointL] IS OLD.[EntryPointL] " + + "AND NEW.[ExitPointL] IS OLD.[ExitPointL] " + + "AND NEW.[PhreaticLevelExitMean] IS OLD.[PhreaticLevelExitMean] " + + "AND NEW.[PhreaticLevelExitStandardDeviation] IS OLD.[PhreaticLevelExitStandardDeviation] " + + "AND NEW.[DampingFactorExitMean] IS OLD.[DampingFactorExitMean] " + + "AND NEW.[DampingFactorExitStandardDeviation] IS OLD.[DampingFactorExitStandardDeviation] " + + "AND NEW.[RelevantForScenario] = OLD.[RelevantForScenario] " + + "AND NEW.[ScenarioContribution] = OLD.[ScenarioContribution] " + + "AND NEW.[AssessmentLevel] IS OLD.[AssessmentLevel] " + + "AND NEW.[UseAssessmentLevelManualInput] = OLD.[UseAssessmentLevelManualInput]; " + + "DETACH SOURCEPROJECT;"; + reader.AssertReturnedDataIsValid(validateCalculationWithValidScenarioContribution); + } + + private static void AssertPipingOutput(MigratedDatabaseReader reader, string sourceFilePath) + { + string validateOutput = + $"ATTACH DATABASE \"{sourceFilePath}\" AS SOURCEPROJECT; " + + "SELECT COUNT() = " + + "(" + + "SELECT COUNT() " + + "FROM SOURCEPROJECT.PipingCalculationOutputEntity " + + "WHERE PipingCalculationEntityId IN (SELECT PipingCalculationEntityId FROM SOURCEPROJECT.PipingCalculationEntity WHERE UseAssessmentLevelManualInput IS 1) " + + ") " + + "FROM SemiProbabilisticPipingCalculationOutputEntity NEW " + + "JOIN SOURCEPROJECT.PipingCalculationOutputEntity OLD " + + "ON NEW.[SemiProbabilisticPipingCalculationOutputEntityId] = OLD.[PipingCalculationOutputEntityId]" + + "WHERE NEW.[SemiProbabilisticPipingCalculationEntityId] = OLD.[PipingCalculationEntityId] " + + "AND NEW.\"Order\" = OLD.\"Order\" " + + "AND NEW.[HeaveFactorOfSafety] IS OLD.[HeaveFactorOfSafety] " + + "AND NEW.[UpliftFactorOfSafety] IS OLD.[UpliftFactorOfSafety] " + + "AND NEW.[SellmeijerFactorOfSafety] IS OLD.[SellmeijerFactorOfSafety] " + + "AND NEW.[UpliftEffectiveStress] IS OLD.[UpliftEffectiveStress] " + + "AND NEW.[HeaveGradient] IS OLD.[HeaveGradient] " + + "AND NEW.[SellmeijerCreepCoefficient] IS OLD.[SellmeijerCreepCoefficient] " + + "AND NEW.[SellmeijerCriticalFall] IS OLD.[SellmeijerCriticalFall] " + + "AND NEW.[SellmeijerReducedFall] IS OLD.[SellmeijerReducedFall]; " + + "DETACH SOURCEPROJECT;"; + reader.AssertReturnedDataIsValid(validateOutput); + } + + private static void AssertDuneLocationOutput(MigratedDatabaseReader reader) + { + const string validateOutput = + "SELECT COUNT() = 0 " + + "FROM [DuneLocationCalculationOutputEntity]; "; + reader.AssertReturnedDataIsValid(validateOutput); + } + + private static void AssertIllustrationPointResults(MigratedDatabaseReader reader) + { + const string validateFaultTreeIllustrationPoint = + "SELECT COUNT() = 0 " + + "FROM [FaultTreeIllustrationPointEntity]; "; + reader.AssertReturnedDataIsValid(validateFaultTreeIllustrationPoint); + + const string validateFaultTreeIllustrationPointStochast = + "SELECT COUNT() = 0 " + + "FROM [FaultTreeIllustrationPointStochastEntity]; "; + reader.AssertReturnedDataIsValid(validateFaultTreeIllustrationPointStochast); + + const string validateFaultTreeSubmechanismIllustrationPoint = + "SELECT COUNT() = 0 " + + "FROM [FaultTreeSubmechanismIllustrationPointEntity]; "; + reader.AssertReturnedDataIsValid(validateFaultTreeSubmechanismIllustrationPoint); + + const string validateGeneralResultFaultTreeIllustrationPoint = + "SELECT COUNT() = 0 " + + "FROM [GeneralResultFaultTreeIllustrationPointEntity]; "; + reader.AssertReturnedDataIsValid(validateGeneralResultFaultTreeIllustrationPoint); + + const string validateGeneralResultFaultTreeIllustrationPointStochast = + "SELECT COUNT() = 0 " + + "FROM [GeneralResultFaultTreeIllustrationPointStochastEntity]; "; + reader.AssertReturnedDataIsValid(validateGeneralResultFaultTreeIllustrationPointStochast); + + const string validateGeneralResultSubMechanismIllustrationPoint = + "SELECT COUNT() = 0 " + + "FROM [GeneralResultSubMechanismIllustrationPointEntity]; "; + reader.AssertReturnedDataIsValid(validateGeneralResultSubMechanismIllustrationPoint); + + const string validateGeneralResultSubMechanismIllustrationPointStochast = + "SELECT COUNT() = 0 " + + "FROM [GeneralResultSubMechanismIllustrationPointStochastEntity]; "; + reader.AssertReturnedDataIsValid(validateGeneralResultSubMechanismIllustrationPointStochast); + + const string validateIllustrationPointResult = + "SELECT COUNT() = 0 " + + "FROM [IllustrationPointResultEntity]; "; + reader.AssertReturnedDataIsValid(validateIllustrationPointResult); + + const string validateSubMechanismIllustrationPoint = + "SELECT COUNT() = 0 " + + "FROM [SubMechanismIllustrationPointEntity]; "; + reader.AssertReturnedDataIsValid(validateSubMechanismIllustrationPoint); + + const string validateSubMechanismIllustrationPointStochast = + "SELECT COUNT() = 0 " + + "FROM [SubMechanismIllustrationPointStochastEntity]; "; + reader.AssertReturnedDataIsValid(validateSubMechanismIllustrationPointStochast); + + const string validateTopLevelFaultTreeIllustrationPoint = + "SELECT COUNT() = 0 " + + "FROM [TopLevelFaultTreeIllustrationPointEntity]; "; + reader.AssertReturnedDataIsValid(validateTopLevelFaultTreeIllustrationPoint); + + const string validateTopLevelSubMechanismIllustrationPoint = + "SELECT COUNT() = 0 " + + "FROM [TopLevelSubMechanismIllustrationPointEntity]; "; + reader.AssertReturnedDataIsValid(validateTopLevelSubMechanismIllustrationPoint); + } + + private static void AssertTablesContentMigrated(MigratedDatabaseReader reader, string sourceFilePath) + { + string[] tables = + { + "AssessmentSectionEntity", + "BackgroundDataEntity", + "BackgroundDataMetaEntity", + "CalculationGroupEntity", + "ClosingStructureEntity", + "ClosingStructuresFailureMechanismMetaEntity", + "DikeProfileEntity", + "DuneErosionFailureMechanismMetaEntity", + "DuneErosionSectionResultEntity", + "DuneLocationCalculationCollectionEntity", + "DuneLocationCalculationEntity", + "DuneLocationEntity", + "FailureMechanismEntity", + "FailureMechanismSectionEntity", + "ForeshoreProfileEntity", + "GrassCoverErosionInwardsFailureMechanismMetaEntity", + "GrassCoverErosionOutwardsFailureMechanismMetaEntity", + "GrassCoverErosionOutwardsSectionResultEntity", + "GrassCoverErosionOutwardsWaveConditionsCalculationEntity", + "GrassCoverSlipOffInwardsSectionResultEntity", + "GrassCoverSlipOffOutwardsSectionResultEntity", + "HeightStructureEntity", + "HeightStructuresFailureMechanismMetaEntity", + "HydraulicBoundaryDatabaseEntity", + "HydraulicLocationCalculationCollectionEntity", + "HydraulicLocationCalculationEntity", + "HydraulicLocationEntity", + "MacroStabilityInwardsCalculationEntity", + "MacroStabilityInwardsCharacteristicPointEntity", + "MacroStabilityInwardsFailureMechanismMetaEntity", + "MacroStabilityInwardsPreconsolidationStressEntity", + "MacroStabilityInwardsSectionResultEntity", + "MacroStabilityInwardsSoilLayerOneDEntity", + "MacroStabilityInwardsSoilLayerTwoDEntity", + "MacroStabilityInwardsSoilProfileOneDEntity", + "MacroStabilityInwardsSoilProfileTwoDEntity", + "MacroStabilityInwardsSoilProfileTwoDSoilLayerTwoDEntity", + "MacroStabilityInwardsStochasticSoilProfileEntity", + "MacroStabilityOutwardsFailureMechanismMetaEntity", + "MacroStabilityOutwardsSectionResultEntity", + "MicrostabilitySectionResultEntity", + "PipingCalculationEntity", + "PipingCharacteristicPointEntity", + "PipingFailureMechanismMetaEntity", + "PipingSectionResultEntity", + "PipingSoilLayerEntity", + "PipingSoilProfileEntity", + "PipingStochasticSoilProfileEntity", + "PipingStructureFailureMechanismMetaEntity", + "PipingStructureSectionResultEntity", + "ProjectEntity", + "StabilityPointStructureEntity", + "StabilityPointStructuresFailureMechanismMetaEntity", + "StabilityStoneCoverFailureMechanismMetaEntity", + "StabilityStoneCoverSectionResultEntity", + "StabilityStoneCoverWaveConditionsCalculationEntity", + "StochastEntity", + "StochasticSoilModelEntity", + "StrengthStabilityLengthwiseConstructionSectionResultEntity", + "SurfaceLineEntity", + "TechnicalInnovationSectionResultEntity", + "VersionEntity", + "WaterPressureAsphaltCoverSectionResultEntity", + "WaveImpactAsphaltCoverFailureMechanismMetaEntity", + "WaveImpactAsphaltCoverSectionResultEntity", + "WaveImpactAsphaltCoverWaveConditionsCalculationEntity" + }; + + foreach (string table in tables) + { + string validateMigratedTable = + $"ATTACH DATABASE \"{sourceFilePath}\" AS SOURCEPROJECT; " + + $"SELECT COUNT() = (SELECT COUNT() FROM [SOURCEPROJECT].{table}) " + + $"FROM {table};" + + "DETACH SOURCEPROJECT;"; + reader.AssertReturnedDataIsValid(validateMigratedTable); + } + } + + private static void AssertVersions(MigratedDatabaseReader reader) + { + const string validateVersion = + "SELECT COUNT() = 1 " + + "FROM [VersionEntity] " + + "WHERE [Version] = \"21.1\";"; + reader.AssertReturnedDataIsValid(validateVersion); + } + + private static void AssertDatabase(MigratedDatabaseReader reader) + { + const string validateForeignKeys = + "PRAGMA foreign_keys;"; + reader.AssertReturnedDataIsValid(validateForeignKeys); + } + + private static void AssertLogDatabase(string logFilePath, IEnumerable expectedMessages) + { + using (var reader = new MigrationLogDatabaseReader(logFilePath)) + { + ReadOnlyCollection messages = reader.GetMigrationLogMessages(); + + Assert.AreEqual(expectedMessages.Count() + 1, messages.Count); + var i = 0; + MigrationLogTestHelper.AssertMigrationLogMessageEqual( + new MigrationLogMessage("19.1", newVersion, "Gevolgen van de migratie van versie 19.1 naar versie 21.1:"), + messages[i++]); + + foreach (string expectedMessage in expectedMessages) + { + MigrationLogTestHelper.AssertMigrationLogMessageEqual( + new MigrationLogMessage("19.1", newVersion, $"* {expectedMessage}"), + messages[i++]); + } + } + } + } +} \ No newline at end of file Index: Riskeer/Migration/test/Riskeer.Migration.Test/ProjectMigratorTest.cs =================================================================== diff -u -re9b8aa3e972b9f07a3201f143c26de0e3f082d49 -r22a1505cd4329747b28df26d6042e997eca20882 --- Riskeer/Migration/test/Riskeer.Migration.Test/ProjectMigratorTest.cs (.../ProjectMigratorTest.cs) (revision e9b8aa3e972b9f07a3201f143c26de0e3f082d49) +++ Riskeer/Migration/test/Riskeer.Migration.Test/ProjectMigratorTest.cs (.../ProjectMigratorTest.cs) (revision 22a1505cd4329747b28df26d6042e997eca20882) @@ -524,7 +524,7 @@ migrationLog.AppendLine("* Traject: 'Demo traject'"); migrationLog.AppendLine(" + Er worden standaardwaarden conform WBI2017 gebruikt voor de HLCD bestandsinformatie."); migrationLog.AppendLine(" + De waarde voor de transparantie van de achtergrondkaart is aangepast naar 0.60."); - migrationLog.AppendLine("Gevolgen van de migratie van versie 19.1 naar versie 20.1:"); + migrationLog.AppendLine("Gevolgen van de migratie van versie 19.1 naar versie 21.1:"); migrationLog.AppendLine("* Geen aanpassingen."); Tuple[] expectedLogMessagesAndLevel =