Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/test-data/AssessmentSectionProvider/project.risk =================================================================== diff -u -r09f0cd44e1bcc96c3be4303951e319f5fdc9ebfa -rab80a69e063d9acaf28b68c610ddbdfc93196d30 Binary files differ Index: Riskeer/Migration/src/Riskeer.Migration.Core/EmbeddedResources/DatabaseStructure20.1.sql =================================================================== diff -u -recec51550f2788cdbdd92fc1a099cd9242b3dfd9 -rab80a69e063d9acaf28b68c610ddbdfc93196d30 --- Riskeer/Migration/src/Riskeer.Migration.Core/EmbeddedResources/DatabaseStructure20.1.sql (.../DatabaseStructure20.1.sql) (revision ecec51550f2788cdbdd92fc1a099cd9242b3dfd9) +++ Riskeer/Migration/src/Riskeer.Migration.Core/EmbeddedResources/DatabaseStructure20.1.sql (.../DatabaseStructure20.1.sql) (revision ab80a69e063d9acaf28b68c610ddbdfc93196d30) @@ -1,6 +1,6 @@ /* ---------------------------------------------------- */ /* Generated by Enterprise Architect Version 14.1 */ -/* Created On : 09-jul-2020 08:39:14 */ +/* Created On : 14-jul-2020 14:27:20 */ /* DBMS : SQLite */ /* ---------------------------------------------------- */ @@ -1762,6 +1762,8 @@ 'DrainCoefficientMean' REAL NULL, 'FailureProbabilityStructureWithErosion' REAL NOT NULL, 'ShouldIllustrationPointsBeCalculated' TINYINT (1) NOT NULL, -- true or false + 'RelevantForScenario' TINYINT (1) NOT NULL, + 'ScenarioContribution' REAL 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, @@ -1796,15 +1798,13 @@ ( 'StabilityPointStructuresSectionResultEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, 'FailureMechanismSectionEntityId' INTEGER NOT NULL, - 'StabilityPointStructuresCalculationEntityId' INTEGER 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, - CONSTRAINT 'FK_StabilityPointStructuresSectionResultEntity_StabilityPointStructuresCalculationEntity' FOREIGN KEY ('StabilityPointStructuresCalculationEntityId') REFERENCES 'StabilityPointStructuresCalculationEntity' ('StabilityPointStructuresCalculationEntityId') ON DELETE Set Null ON UPDATE Cascade + CONSTRAINT 'FK_StabilityPointStructuresSectionResultEntity_FailureMechanismSectionEntity' FOREIGN KEY ('FailureMechanismSectionEntityId') REFERENCES 'FailureMechanismSectionEntity' ('FailureMechanismSectionEntityId') ON DELETE Cascade ON UPDATE Cascade ) ; @@ -2738,10 +2738,6 @@ ON 'StabilityPointStructuresSectionResultEntity' ('FailureMechanismSectionEntityId' ASC) ; -CREATE INDEX 'IXFK_StabilityPointStructuresSectionResultEntity_StabilityPointStructuresCalculationEntity' - ON 'StabilityPointStructuresSectionResultEntity' ('StabilityPointStructuresCalculationEntityId' ASC) -; - CREATE INDEX 'IXFK_StabilityStoneCoverFailureMechanismMetaEntity_FailureMechanismEntity' ON 'StabilityStoneCoverFailureMechanismMetaEntity' ('FailureMechanismEntityId' ASC) ; Index: Riskeer/Migration/src/Riskeer.Migration.Core/EmbeddedResources/Migration_19.1_20.1.sql =================================================================== diff -u -recec51550f2788cdbdd92fc1a099cd9242b3dfd9 -rab80a69e063d9acaf28b68c610ddbdfc93196d30 --- Riskeer/Migration/src/Riskeer.Migration.Core/EmbeddedResources/Migration_19.1_20.1.sql (.../Migration_19.1_20.1.sql) (revision ecec51550f2788cdbdd92fc1a099cd9242b3dfd9) +++ Riskeer/Migration/src/Riskeer.Migration.Core/EmbeddedResources/Migration_19.1_20.1.sql (.../Migration_19.1_20.1.sql) (revision ab80a69e063d9acaf28b68c610ddbdfc93196d30) @@ -397,10 +397,178 @@ INSERT INTO PipingStructureSectionResultEntity SELECT * FROM [SOURCEPROJECT].PipingStructureSectionResultEntity; INSERT INTO ProjectEntity SELECT * FROM [SOURCEPROJECT].ProjectEntity; INSERT INTO StabilityPointStructureEntity SELECT * FROM [SOURCEPROJECT].StabilityPointStructureEntity; -INSERT INTO StabilityPointStructuresCalculationEntity SELECT * FROM [SOURCEPROJECT].StabilityPointStructuresCalculationEntity; +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], + [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], + [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 StabilityPointStructuresOutputEntity SELECT * FROM [SOURCEPROJECT].StabilityPointStructuresOutputEntity; -INSERT INTO StabilityPointStructuresSectionResultEntity SELECT * FROM [SOURCEPROJECT].StabilityPointStructuresSectionResultEntity; +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; Index: Riskeer/Migration/test/Riskeer.Migration.Core.Test/test-data/MigrationTestProject191.risk =================================================================== diff -u -recec51550f2788cdbdd92fc1a099cd9242b3dfd9 -rab80a69e063d9acaf28b68c610ddbdfc93196d30 Binary files differ Index: Riskeer/Migration/test/Riskeer.Migration.Core.Test/test-data/MigrationTestProject201.risk =================================================================== diff -u -recec51550f2788cdbdd92fc1a099cd9242b3dfd9 -rab80a69e063d9acaf28b68c610ddbdfc93196d30 Binary files differ Index: Riskeer/Migration/test/Riskeer.Migration.Integration.Test/MigrationTo201IntegrationTest.cs =================================================================== diff -u -recec51550f2788cdbdd92fc1a099cd9242b3dfd9 -rab80a69e063d9acaf28b68c610ddbdfc93196d30 --- Riskeer/Migration/test/Riskeer.Migration.Integration.Test/MigrationTo201IntegrationTest.cs (.../MigrationTo201IntegrationTest.cs) (revision ecec51550f2788cdbdd92fc1a099cd9242b3dfd9) +++ Riskeer/Migration/test/Riskeer.Migration.Integration.Test/MigrationTo201IntegrationTest.cs (.../MigrationTo201IntegrationTest.cs) (revision ab80a69e063d9acaf28b68c610ddbdfc93196d30) @@ -70,6 +70,9 @@ AssertHeightStructuresCalculation(reader, sourceFilePath); AssertHeightStructuresSectionResult(reader, sourceFilePath); + AssertStabilityPointStructuresCalculation(reader, sourceFilePath); + AssertStabilityPointStructuresSectionResult(reader, sourceFilePath); + AssertMacroStabilityInwardsOutput(reader); } @@ -430,6 +433,187 @@ 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.[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.[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 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 AssertTablesContentMigrated(MigratedDatabaseReader reader, string sourceFilePath) { string[] tables =