Index: Riskeer/Migration/src/Riskeer.Migration.Core/EmbeddedResources/DatabaseStructure20.1.sql =================================================================== diff -u -rab80a69e063d9acaf28b68c610ddbdfc93196d30 -rab70956b184642e2345539dc2cb996dabc81be19 --- Riskeer/Migration/src/Riskeer.Migration.Core/EmbeddedResources/DatabaseStructure20.1.sql (.../DatabaseStructure20.1.sql) (revision ab80a69e063d9acaf28b68c610ddbdfc93196d30) +++ Riskeer/Migration/src/Riskeer.Migration.Core/EmbeddedResources/DatabaseStructure20.1.sql (.../DatabaseStructure20.1.sql) (revision ab70956b184642e2345539dc2cb996dabc81be19) @@ -1,6 +1,6 @@ /* ---------------------------------------------------- */ /* Generated by Enterprise Architect Version 14.1 */ -/* Created On : 14-jul-2020 14:27:20 */ +/* Created On : 05-aug-2020 08:38:49 */ /* DBMS : SQLite */ /* ---------------------------------------------------- */ @@ -1576,11 +1576,8 @@ 'PipingCalculationEntityId' INTEGER NOT NULL, 'Order' INT (4) NOT NULL, 'HeaveFactorOfSafety' REAL NULL, - 'HeaveZValue' REAL NULL, 'UpliftFactorOfSafety' REAL NULL, - 'UpliftZValue' REAL NULL, 'SellmeijerFactorOfSafety' REAL NULL, - 'SellmeijerZValue' REAL NULL, 'UpliftEffectiveStress' REAL NULL, 'HeaveGradient' REAL NULL, 'SellmeijerCreepCoefficient' REAL NULL, Index: Riskeer/Migration/src/Riskeer.Migration.Core/EmbeddedResources/Migration_19.1_20.1.sql =================================================================== diff -u -rab80a69e063d9acaf28b68c610ddbdfc93196d30 -rab70956b184642e2345539dc2cb996dabc81be19 --- Riskeer/Migration/src/Riskeer.Migration.Core/EmbeddedResources/Migration_19.1_20.1.sql (.../Migration_19.1_20.1.sql) (revision ab80a69e063d9acaf28b68c610ddbdfc93196d30) +++ Riskeer/Migration/src/Riskeer.Migration.Core/EmbeddedResources/Migration_19.1_20.1.sql (.../Migration_19.1_20.1.sql) (revision ab70956b184642e2345539dc2cb996dabc81be19) @@ -386,7 +386,31 @@ INSERT INTO MacroStabilityOutwardsSectionResultEntity SELECT * FROM [SOURCEPROJECT].MacroStabilityOutwardsSectionResultEntity; INSERT INTO MicrostabilitySectionResultEntity SELECT * FROM [SOURCEPROJECT].MicrostabilitySectionResultEntity; INSERT INTO PipingCalculationEntity SELECT * FROM [SOURCEPROJECT].PipingCalculationEntity; -INSERT INTO PipingCalculationOutputEntity SELECT * FROM [SOURCEPROJECT].PipingCalculationOutputEntity; +INSERT INTO PipingCalculationOutputEntity( + [PipingCalculationOutputEntityId], + [PipingCalculationEntityId], + [Order], + [HeaveFactorOfSafety], + [UpliftFactorOfSafety], + [SellmeijerFactorOfSafety], + [UpliftEffectiveStress], + [HeaveGradient], + [SellmeijerCreepCoefficient], + [SellmeijerCriticalFall], + [SellmeijerReducedFall]) +SELECT + [PipingCalculationOutputEntityId], + [PipingCalculationEntityId], + [Order], + [HeaveFactorOfSafety], + [UpliftFactorOfSafety], + [SellmeijerFactorOfSafety], + [UpliftEffectiveStress], + [HeaveGradient], + [SellmeijerCreepCoefficient], + [SellmeijerCriticalFall], + [SellmeijerReducedFall] +FROM [SOURCEPROJECT].PipingCalculationOutputEntity; INSERT INTO PipingCharacteristicPointEntity SELECT * FROM [SOURCEPROJECT].PipingCharacteristicPointEntity; INSERT INTO PipingFailureMechanismMetaEntity SELECT * FROM [SOURCEPROJECT].PipingFailureMechanismMetaEntity; INSERT INTO PipingSectionResultEntity SELECT * FROM [SOURCEPROJECT].PipingSectionResultEntity; Index: Riskeer/Migration/test/Riskeer.Migration.Core.Test/test-data/MigrationTestProject191.risk =================================================================== diff -u -rab80a69e063d9acaf28b68c610ddbdfc93196d30 -rab70956b184642e2345539dc2cb996dabc81be19 Binary files differ Index: Riskeer/Migration/test/Riskeer.Migration.Core.Test/test-data/MigrationTestProject201.risk =================================================================== diff -u -rab80a69e063d9acaf28b68c610ddbdfc93196d30 -rab70956b184642e2345539dc2cb996dabc81be19 Binary files differ Index: Riskeer/Migration/test/Riskeer.Migration.Integration.Test/MigrationTo201IntegrationTest.cs =================================================================== diff -u -rab80a69e063d9acaf28b68c610ddbdfc93196d30 -rab70956b184642e2345539dc2cb996dabc81be19 --- Riskeer/Migration/test/Riskeer.Migration.Integration.Test/MigrationTo201IntegrationTest.cs (.../MigrationTo201IntegrationTest.cs) (revision ab80a69e063d9acaf28b68c610ddbdfc93196d30) +++ Riskeer/Migration/test/Riskeer.Migration.Integration.Test/MigrationTo201IntegrationTest.cs (.../MigrationTo201IntegrationTest.cs) (revision ab70956b184642e2345539dc2cb996dabc81be19) @@ -74,6 +74,8 @@ AssertStabilityPointStructuresSectionResult(reader, sourceFilePath); AssertMacroStabilityInwardsOutput(reader); + + AssertPipingOutput(reader, sourceFilePath); } AssertLogDatabase(logFilePath); @@ -614,6 +616,40 @@ reader.AssertReturnedDataIsValid(validateSectionResults); } + private static void AssertMacroStabilityInwardsOutput(MigratedDatabaseReader reader) + { + const string macroStabilityInwardsCalculationOutputEntityTable = + "SELECT COUNT() = 0 " + + "FROM MacroStabilityInwardsCalculationOutputEntity;" + + "DETACH SOURCEPROJECT;"; + reader.AssertReturnedDataIsValid(macroStabilityInwardsCalculationOutputEntityTable); + } + + private static void AssertPipingOutput(MigratedDatabaseReader reader, string sourceFilePath) + { + string validateSectionResults = + $"ATTACH DATABASE \"{sourceFilePath}\" AS SOURCEPROJECT; " + + "SELECT COUNT() = " + + "(" + + "SELECT COUNT() " + + "FROM SOURCEPROJECT.PipingCalculationOutputEntity" + + ") " + + "FROM PipingCalculationOutputEntity NEW " + + "JOIN SOURCEPROJECT.PipingCalculationOutputEntity OLD USING(PipingCalculationOutputEntityId) " + + "WHERE NEW.[PipingCalculationEntityId] = 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(validateSectionResults); + } + private static void AssertTablesContentMigrated(MigratedDatabaseReader reader, string sourceFilePath) { string[] tables = @@ -623,10 +659,8 @@ "BackgroundDataMetaEntity", "CalculationGroupEntity", "ClosingStructureEntity", - "ClosingStructuresCalculationEntity", "ClosingStructuresFailureMechanismMetaEntity", "ClosingStructuresOutputEntity", - "ClosingStructuresSectionResultEntity", "DikeProfileEntity", "DuneErosionFailureMechanismMetaEntity", "DuneErosionSectionResultEntity", @@ -655,10 +689,8 @@ "GrassCoverSlipOffInwardsSectionResultEntity", "GrassCoverSlipOffOutwardsSectionResultEntity", "HeightStructureEntity", - "HeightStructuresCalculationEntity", "HeightStructuresFailureMechanismMetaEntity", "HeightStructuresOutputEntity", - "HeightStructuresSectionResultEntity", "HydraulicBoundaryDatabaseEntity", "HydraulicLocationCalculationCollectionEntity", "HydraulicLocationCalculationEntity", @@ -680,7 +712,6 @@ "MacroStabilityOutwardsSectionResultEntity", "MicrostabilitySectionResultEntity", "PipingCalculationEntity", - "PipingCalculationOutputEntity", "PipingCharacteristicPointEntity", "PipingFailureMechanismMetaEntity", "PipingSectionResultEntity", @@ -691,10 +722,8 @@ "PipingStructureSectionResultEntity", "ProjectEntity", "StabilityPointStructureEntity", - "StabilityPointStructuresCalculationEntity", "StabilityPointStructuresFailureMechanismMetaEntity", "StabilityPointStructuresOutputEntity", - "StabilityPointStructuresSectionResultEntity", "StabilityStoneCoverFailureMechanismMetaEntity", "StabilityStoneCoverSectionResultEntity", "StabilityStoneCoverWaveConditionsCalculationEntity", @@ -727,15 +756,6 @@ } } - private static void AssertMacroStabilityInwardsOutput(MigratedDatabaseReader reader) - { - const string macroStabilityInwardsCalculationOutputEntityTable = - "SELECT COUNT() = 0 " + - "FROM MacroStabilityInwardsCalculationOutputEntity;" + - "DETACH SOURCEPROJECT;"; - reader.AssertReturnedDataIsValid(macroStabilityInwardsCalculationOutputEntityTable); - } - private static void AssertVersions(MigratedDatabaseReader reader) { const string validateVersion =