Index: Ringtoets/Migration/src/Ringtoets.Migration.Core/EmbeddedResources/Migration_17.3_18.1.sql =================================================================== diff -u -rc34002da854486928c4dfa4a718d39561f10a973 -ree67290cbfd58a5022cb117dc9fd9a4a457b1da8 --- Ringtoets/Migration/src/Ringtoets.Migration.Core/EmbeddedResources/Migration_17.3_18.1.sql (.../Migration_17.3_18.1.sql) (revision c34002da854486928c4dfa4a718d39561f10a973) +++ Ringtoets/Migration/src/Ringtoets.Migration.Core/EmbeddedResources/Migration_17.3_18.1.sql (.../Migration_17.3_18.1.sql) (revision ee67290cbfd58a5022cb117dc9fd9a4a457b1da8) @@ -182,17 +182,6 @@ [ShouldIllustrationPointsBeCalculated] FROM [SOURCEPROJECT].ClosingStructuresCalculationEntity; INSERT INTO ClosingStructuresFailureMechanismMetaEntity SELECT * FROM [SOURCEPROJECT].ClosingStructuresFailureMechanismMetaEntity; -INSERT INTO ClosingStructuresOutputEntity( - [ClosingStructuresOutputEntityId], - [ClosingStructuresCalculationEntityId], - [GeneralResultFaultTreeIllustrationPointEntityId], - [Reliability]) -SELECT - [ClosingStructuresOutputEntityId], - [ClosingStructuresCalculationEntityId], - [GeneralResultFaultTreeIllustrationPointEntityId], - [Reliability] -FROM [SOURCEPROJECT].ClosingStructuresOutputEntity; INSERT INTO ClosingStructuresSectionResultEntity ( [ClosingStructuresSectionResultEntityId], [FailureMechanismSectionEntityId], @@ -327,9 +316,6 @@ 'SerializablePoint2D' ) FROM [SOURCEPROJECT].FailureMechanismSectionEntity; -INSERT INTO FaultTreeIllustrationPointEntity SELECT * FROM [SOURCEPROJECT].FaultTreeIllustrationPointEntity; -INSERT INTO FaultTreeIllustrationPointStochastEntity SELECT * FROM [SOURCEPROJECT].FaultTreeIllustrationPointStochastEntity; -INSERT INTO FaultTreeSubmechanismIllustrationPointEntity SELECT * FROM [SOURCEPROJECT].FaultTreeSubmechanismIllustrationPointEntity; INSERT INTO ForeshoreProfileEntity ( [ForeshoreProfileEntityId], [FailureMechanismEntityId], @@ -361,31 +347,8 @@ [X0], [Order] FROM [SOURCEPROJECT].ForeshoreProfileEntity; -INSERT INTO GeneralResultFaultTreeIllustrationPointEntity SELECT * FROM [SOURCEPROJECT].GeneralResultFaultTreeIllustrationPointEntity; -INSERT INTO GeneralResultFaultTreeIllustrationPointStochastEntity SELECT * FROM [SOURCEPROJECT].GeneralResultFaultTreeIllustrationPointStochastEntity; -INSERT INTO GeneralResultSubMechanismIllustrationPointEntity SELECT * FROM [SOURCEPROJECT].GeneralResultSubMechanismIllustrationPointEntity; -INSERT INTO GeneralResultSubMechanismIllustrationPointStochastEntity SELECT * FROM [SOURCEPROJECT].GeneralResultSubMechanismIllustrationPointStochastEntity; INSERT INTO GrassCoverErosionInwardsCalculationEntity SELECT * FROM [SOURCEPROJECT].GrassCoverErosionInwardsCalculationEntity; -INSERT INTO GrassCoverErosionInwardsDikeHeightOutputEntity SELECT * FROM [SOURCEPROJECT].GrassCoverErosionInwardsDikeHeightOutputEntity; INSERT INTO GrassCoverErosionInwardsFailureMechanismMetaEntity SELECT * FROM [SOURCEPROJECT].GrassCoverErosionInwardsFailureMechanismMetaEntity; -INSERT INTO GrassCoverErosionInwardsOutputEntity( - [GrassCoverErosionInwardsOutputEntityId], - [GrassCoverErosionInwardsCalculationEntityId], - [GeneralResultFaultTreeIllustrationPointEntityId], - [Order], - [IsOvertoppingDominant], - [WaveHeight], - [Reliability]) -SELECT - [GrassCoverErosionInwardsOutputEntityId], - [GrassCoverErosionInwardsCalculationEntityId], - [GeneralResultFaultTreeIllustrationPointEntityId], - [Order], - [IsOvertoppingDominant], - [WaveHeight], - [Reliability] -FROM [SOURCEPROJECT].GrassCoverErosionInwardsOutputEntity; -INSERT INTO GrassCoverErosionInwardsOvertoppingRateOutputEntity SELECT * FROM [SOURCEPROJECT].GrassCoverErosionInwardsOvertoppingRateOutputEntity; INSERT INTO GrassCoverErosionInwardsSectionResultEntity ( [GrassCoverErosionInwardsSectionResultEntityId], [FailureMechanismSectionEntityId], @@ -442,7 +405,6 @@ 0, 1 FROM [SOURCEPROJECT].GrassCoverErosionOutwardsSectionResultEntity; -INSERT INTO GrassCoverErosionOutwardsWaveConditionsOutputEntity SELECT * FROM [SOURCEPROJECT].GrassCoverErosionOutwardsWaveConditionsOutputEntity; INSERT INTO GrassCoverSlipOffInwardsSectionResultEntity ( [GrassCoverSlipOffInwardsSectionResultEntityId], [FailureMechanismSectionEntityId], @@ -490,17 +452,6 @@ INSERT INTO HeightStructureEntity SELECT * FROM [SOURCEPROJECT].HeightStructureEntity; INSERT INTO HeightStructuresCalculationEntity SELECT * FROM [SOURCEPROJECT].HeightStructuresCalculationEntity; INSERT INTO HeightStructuresFailureMechanismMetaEntity SELECT * FROM [SOURCEPROJECT].HeightStructuresFailureMechanismMetaEntity; -INSERT INTO HeightStructuresOutputEntity( - [HeightStructuresOutputEntityId], - [HeightStructuresCalculationEntityId], - [GeneralResultFaultTreeIllustrationPointEntityId], - [Reliability]) -SELECT - [HeightStructuresOutputEntityId], - [HeightStructuresCalculationEntityId], - [GeneralResultFaultTreeIllustrationPointEntityId], - [Reliability] -FROM [SOURCEPROJECT].HeightStructuresOutputEntity; INSERT INTO HeightStructuresSectionResultEntity ( [HeightStructuresSectionResultEntityId], [FailureMechanismSectionEntityId], @@ -1047,17 +998,6 @@ [ShouldIllustrationPointsBeCalculated] FROM [SOURCEPROJECT].StabilityPointStructuresCalculationEntity; INSERT INTO StabilityPointStructuresFailureMechanismMetaEntity SELECT * FROM [SOURCEPROJECT].StabilityPointStructuresFailureMechanismMetaEntity; -INSERT INTO StabilityPointStructuresOutputEntity( - [StabilityPointStructuresOutputEntityId], - [StabilityPointStructuresCalculationEntityId], - [GeneralResultFaultTreeIllustrationPointEntityId], - [Reliability]) -SELECT - [StabilityPointStructuresOutputEntity], - [StabilityPointStructuresCalculationEntityId], - [GeneralResultFaultTreeIllustrationPointEntityId], - [Reliability] -FROM [SOURCEPROJECT].StabilityPointStructuresOutputEntity; INSERT INTO StabilityPointStructuresSectionResultEntity ( [StabilityPointStructuresSectionResultEntityId], [FailureMechanismSectionEntityId], @@ -1167,8 +1107,6 @@ JOIN [SOURCEPROJECT].CalculationGroupEntity USING(CalculationGroupEntityId) JOIN [SOURCEPROJECT].FailureMechanismEntity USING(CalculationGroupEntityId) JOIN [SOURCEPROJECT].AssessmentSectionEntity USING(AssessmentSectionEntityId); -INSERT INTO StabilityStoneCoverWaveConditionsOutputEntity SELECT * FROM [SOURCEPROJECT].StabilityStoneCoverWaveConditionsOutputEntity; -INSERT INTO StochastEntity SELECT * FROM [SOURCEPROJECT].StochastEntity; INSERT INTO StochasticSoilModelEntity ( [StochasticSoilModelEntityId], [FailureMechanismEntityId], @@ -1206,8 +1144,6 @@ 0, 1 FROM [SOURCEPROJECT].StrengthStabilityLengthwiseConstructionSectionResultEntity; -INSERT INTO SubMechanismIllustrationPointEntity SELECT * FROM [SOURCEPROJECT].SubMechanismIllustrationPointEntity; -INSERT INTO SubMechanismIllustrationPointStochastEntity SELECT * FROM [SOURCEPROJECT].SubMechanismIllustrationPointStochastEntity; INSERT INTO SurfaceLineEntity( [SurfaceLineEntityId], [FailureMechanismEntityId], @@ -1249,8 +1185,6 @@ 0, 1 FROM [SOURCEPROJECT].TechnicalInnovationSectionResultEntity; -INSERT INTO TopLevelFaultTreeIllustrationPointEntity SELECT * FROM [SOURCEPROJECT].TopLevelFaultTreeIllustrationPointEntity; -INSERT INTO TopLevelSubMechanismIllustrationPointEntity SELECT * FROM [SOURCEPROJECT].TopLevelSubMechanismIllustrationPointEntity; INSERT INTO VersionEntity ( [VersionId], [Version], @@ -1369,7 +1303,6 @@ JOIN [SOURCEPROJECT].CalculationGroupEntity USING(CalculationGroupEntityId) JOIN [SOURCEPROJECT].FailureMechanismEntity USING(CalculationGroupEntityId) JOIN [SOURCEPROJECT].AssessmentSectionEntity USING(AssessmentSectionEntityId); -INSERT INTO WaveImpactAsphaltCoverWaveConditionsOutputEntity SELECT * FROM [SOURCEPROJECT].WaveImpactAsphaltCoverWaveConditionsOutputEntity; /* Insert new data Index: Ringtoets/Migration/test/Ringtoets.Migration.Core.Test/test-data/MigrationTestProject173.rtd =================================================================== diff -u -r5de28085e77cc3631dd15594dbdfb746e3aebfc9 -ree67290cbfd58a5022cb117dc9fd9a4a457b1da8 Binary files differ Index: Ringtoets/Migration/test/Ringtoets.Migration.Integration.Test/MigrationTo181IntegrationTest.cs =================================================================== diff -u -rc34002da854486928c4dfa4a718d39561f10a973 -ree67290cbfd58a5022cb117dc9fd9a4a457b1da8 --- Ringtoets/Migration/test/Ringtoets.Migration.Integration.Test/MigrationTo181IntegrationTest.cs (.../MigrationTo181IntegrationTest.cs) (revision c34002da854486928c4dfa4a718d39561f10a973) +++ Ringtoets/Migration/test/Ringtoets.Migration.Integration.Test/MigrationTo181IntegrationTest.cs (.../MigrationTo181IntegrationTest.cs) (revision ee67290cbfd58a5022cb117dc9fd9a4a457b1da8) @@ -85,16 +85,13 @@ AssertHydraulicBoundaryLocationsOnAssessmentSection(reader, sourceFilePath); AssertHydraulicBoundaryLocationsOnGrassCoverErosionOutwardsFailureMechanism(reader, sourceFilePath); AssertFailureMechanisms(reader, sourceFilePath); + AssertFailureMechanismRelatedOutput(reader); AssertPipingSoilLayers(reader); AssertStabilityStoneCoverFailureMechanism(reader); AssertMacroStabilityOutwardsFailureMechanism(reader); AssertPipingStructureFailureMechanism(reader); AssertWaveImpactAsphaltCoverFailureMechanism(reader); - AssertGrassCoverErosionInwardsOutput(reader, sourceFilePath); - AssertClosingStructuresOutput(reader, sourceFilePath); - AssertHeightStructuresOutput(reader, sourceFilePath); - AssertStabilityPointStructuresOutput(reader, sourceFilePath); AssertGrassCoverErosionOutwardsFailureMechanismMetaEntity(reader, sourceFilePath); @@ -409,38 +406,25 @@ "ClosingStructureEntity", "ClosingStructuresCalculationEntity", "ClosingStructuresFailureMechanismMetaEntity", - "ClosingStructuresOutputEntity", "ClosingStructuresSectionResultEntity", "DikeProfileEntity", "DuneErosionFailureMechanismMetaEntity", "DuneErosionSectionResultEntity", "DuneLocationEntity", "FailureMechanismEntity", "FailureMechanismSectionEntity", - "FaultTreeIllustrationPointEntity", - "FaultTreeIllustrationPointStochastEntity", - "FaultTreeSubmechanismIllustrationPointEntity", "ForeshoreProfileEntity", - "GeneralResultFaultTreeIllustrationPointEntity", - "GeneralResultFaultTreeIllustrationPointStochastEntity", - "GeneralResultSubMechanismIllustrationPointEntity", - "GeneralResultSubMechanismIllustrationPointStochastEntity", "GrassCoverErosionInwardsCalculationEntity", - "GrassCoverErosionInwardsDikeHeightOutputEntity", "GrassCoverErosionInwardsFailureMechanismMetaEntity", - "GrassCoverErosionInwardsOutputEntity", - "GrassCoverErosionInwardsOvertoppingRateOutputEntity", "GrassCoverErosionInwardsSectionResultEntity", "GrassCoverErosionOutwardsFailureMechanismMetaEntity", "GrassCoverErosionOutwardsSectionResultEntity", "GrassCoverErosionOutwardsWaveConditionsCalculationEntity", - "GrassCoverErosionOutwardsWaveConditionsOutputEntity", "GrassCoverSlipOffInwardsSectionResultEntity", "GrassCoverSlipOffOutwardsSectionResultEntity", "HeightStructureEntity", "HeightStructuresCalculationEntity", "HeightStructuresFailureMechanismMetaEntity", - "HeightStructuresOutputEntity", "HeightStructuresSectionResultEntity", "HydraulicLocationEntity", "IllustrationPointResultEntity", @@ -473,26 +457,18 @@ "StabilityPointStructureEntity", "StabilityPointStructuresCalculationEntity", "StabilityPointStructuresFailureMechanismMetaEntity", - "StabilityPointStructuresOutputEntity", "StabilityPointStructuresSectionResultEntity", "StabilityStoneCoverSectionResultEntity", "StabilityStoneCoverWaveConditionsCalculationEntity", - "StabilityStoneCoverWaveConditionsOutputEntity", - "StochastEntity", "StochasticSoilModelEntity", "StrengthStabilityLengthwiseConstructionSectionResultEntity", - "SubMechanismIllustrationPointEntity", - "SubMechanismIllustrationPointStochastEntity", "SurfaceLineEntity", "TechnicalInnovationSectionResultEntity", - "TopLevelFaultTreeIllustrationPointEntity", - "TopLevelSubMechanismIllustrationPointEntity", "VersionEntity", "WaterPressureAsphaltCoverSectionResultEntity", "WaveImpactAsphaltCoverFailureMechanismMetaEntity", "WaveImpactAsphaltCoverSectionResultEntity", - "WaveImpactAsphaltCoverWaveConditionsCalculationEntity", - "WaveImpactAsphaltCoverWaveConditionsOutputEntity" + "WaveImpactAsphaltCoverWaveConditionsCalculationEntity" }; foreach (string table in tables) @@ -883,64 +859,6 @@ reader.AssertReturnedDataIsValid(validateWaveImpactAsphaltCoverFailureMechanisms); } - private static void AssertGrassCoverErosionInwardsOutput(MigratedDatabaseReader reader, string sourceFilePath) - { - string validateGrassCoverErosionInwardsOutputEntities = - $"ATTACH DATABASE \"{sourceFilePath}\" AS SOURCEPROJECT; " + - "SELECT COUNT() = (SELECT COUNT() FROM [SOURCEPROJECT].GrassCoverErosionInwardsOutputEntity) " + - "FROM GrassCoverErosionInwardsOutputEntity NEW " + - "JOIN [SOURCEPROJECT].GrassCoverErosionInwardsOutputEntity OLD USING(GrassCoverErosionInwardsOutputEntityId) " + - "WHERE NEW.GrassCoverErosionInwardsCalculationEntityId = OLD.GrassCoverErosionInwardsCalculationEntityId " + - "AND NEW.GeneralResultFaultTreeIllustrationPointEntityId IS OLD.GeneralResultFaultTreeIllustrationPointEntityId " + - "AND NEW.IsOvertoppingDominant = OLD.IsOvertoppingDominant " + - "AND NEW.WaveHeight IS OLD.WaveHeight " + - "AND NEW.Reliability IS OLD.Reliability;" + - "DETACH DATABASE SOURCEPROJECT;"; - reader.AssertReturnedDataIsValid(validateGrassCoverErosionInwardsOutputEntities); - } - - private static void AssertClosingStructuresOutput(MigratedDatabaseReader reader, string sourceFilePath) - { - string validateClosingStructuresOutputEntities = - $"ATTACH DATABASE \"{sourceFilePath}\" AS SOURCEPROJECT; " + - "SELECT COUNT() = (SELECT COUNT() FROM [SOURCEPROJECT].ClosingStructuresOutputEntity) " + - "FROM ClosingStructuresOutputEntity NEW " + - "JOIN [SOURCEPROJECT].ClosingStructuresOutputEntity OLD USING(ClosingStructuresOutputEntityId) " + - "WHERE NEW.ClosingStructuresCalculationEntityId = OLD.ClosingStructuresCalculationEntityId " + - "AND NEW.GeneralResultFaultTreeIllustrationPointEntityId IS OLD.GeneralResultFaultTreeIllustrationPointEntityId " + - "AND NEW.Reliability IS OLD.Reliability;" + - "DETACH DATABASE SOURCEPROJECT;"; - reader.AssertReturnedDataIsValid(validateClosingStructuresOutputEntities); - } - - private static void AssertHeightStructuresOutput(MigratedDatabaseReader reader, string sourceFilePath) - { - string validateHeightStructuresOutputEntities = - $"ATTACH DATABASE \"{sourceFilePath}\" AS SOURCEPROJECT; " + - "SELECT COUNT() = (SELECT COUNT() FROM [SOURCEPROJECT].HeightStructuresOutputEntity) " + - "FROM HeightStructuresOutputEntity NEW " + - "JOIN [SOURCEPROJECT].HeightStructuresOutputEntity OLD USING(HeightStructuresOutputEntityId) " + - "WHERE NEW.HeightStructuresCalculationEntityId = OLD.HeightStructuresCalculationEntityId " + - "AND NEW.GeneralResultFaultTreeIllustrationPointEntityId IS OLD.GeneralResultFaultTreeIllustrationPointEntityId " + - "AND NEW.Reliability IS OLD.Reliability;" + - "DETACH DATABASE SOURCEPROJECT;"; - reader.AssertReturnedDataIsValid(validateHeightStructuresOutputEntities); - } - - private static void AssertStabilityPointStructuresOutput(MigratedDatabaseReader reader, string sourceFilePath) - { - string validateStabilityPointStructuresOutputEntities = - $"ATTACH DATABASE \"{sourceFilePath}\" AS SOURCEPROJECT; " + - "SELECT COUNT() = (SELECT COUNT() FROM [SOURCEPROJECT].StabilityPointStructuresOutputEntity) " + - "FROM StabilityPointStructuresOutputEntity NEW " + - "JOIN [SOURCEPROJECT].StabilityPointStructuresOutputEntity OLD ON OLD.StabilityPointStructuresOutputEntity = NEW.StabilityPointStructuresOutputEntityId " + - "WHERE NEW.StabilityPointStructuresCalculationEntityId = OLD.StabilityPointStructuresCalculationEntityId " + - "AND NEW.GeneralResultFaultTreeIllustrationPointEntityId IS OLD.GeneralResultFaultTreeIllustrationPointEntityId " + - "AND NEW.Reliability IS OLD.Reliability;" + - "DETACH DATABASE SOURCEPROJECT;"; - reader.AssertReturnedDataIsValid(validateStabilityPointStructuresOutputEntities); - } - private static void AssertAssessmentSection(MigratedDatabaseReader reader, string sourceFilePath) { string validateAssessmentSectionEntities = @@ -1080,6 +998,43 @@ reader.AssertReturnedDataIsValid(validateMetaEntity); } + private static void AssertFailureMechanismRelatedOutput(MigratedDatabaseReader reader) + { + var tables = new[] + { + "ClosingStructuresOutputEntity", + "GrassCoverErosionOutwardsWaveConditionsOutputEntity", + "GrassCoverErosionInwardsDikeHeightOutputEntity", + "GrassCoverErosionInwardsOutputEntity", + "GrassCoverErosionInwardsOvertoppingRateOutputEntity", + "HeightStructuresOutputEntity", + "StabilityPointStructuresOutputEntity", + "StabilityStoneCoverWaveConditionsOutputEntity", + "WaveImpactAsphaltCoverWaveConditionsOutputEntity", + "TopLevelFaultTreeIllustrationPointEntity", + "TopLevelSubMechanismIllustrationPointEntity", + "GeneralResultFaultTreeIllustrationPointEntity", + "GeneralResultFaultTreeIllustrationPointStochastEntity", + "GeneralResultSubMechanismIllustrationPointEntity", + "GeneralResultSubMechanismIllustrationPointStochastEntity", + "SubMechanismIllustrationPointEntity", + "SubMechanismIllustrationPointStochastEntity", + "FaultTreeIllustrationPointEntity", + "FaultTreeIllustrationPointStochastEntity", + "FaultTreeSubmechanismIllustrationPointEntity", + "StochastEntity" + }; + + foreach (string table in tables) + { + string validateMigratedTable = + "SELECT COUNT() = 0 " + + $"FROM {table};" + + "DETACH SOURCEPROJECT;"; + reader.AssertReturnedDataIsValid(validateMigratedTable); + } + } + #region Dune Locations ///