Index: Application/Ringtoets/src/Application.Ringtoets.Migration.Core/EmbeddedResources/Migration_17.1_17.2.sql =================================================================== diff -u -rae47ec1ec171e74d0eedf64cf0bcda742bc5f289 -r93776a3d8b9dcefa4e31ff43a2e6eb3bbd6e4cc0 --- Application/Ringtoets/src/Application.Ringtoets.Migration.Core/EmbeddedResources/Migration_17.1_17.2.sql (.../Migration_17.1_17.2.sql) (revision ae47ec1ec171e74d0eedf64cf0bcda742bc5f289) +++ Application/Ringtoets/src/Application.Ringtoets.Migration.Core/EmbeddedResources/Migration_17.1_17.2.sql (.../Migration_17.1_17.2.sql) (revision 93776a3d8b9dcefa4e31ff43a2e6eb3bbd6e4cc0) @@ -322,18 +322,18 @@ INSERT INTO BackgroundDataMetaEntity SELECT * FROM [SOURCEPROJECT].BackgroundDataMetaEntity; INSERT INTO CalculationGroupEntity SELECT * FROM [SOURCEPROJECT].CalculationGroupEntity; INSERT INTO PipingCharacteristicPointEntity ( - [PipingCharacteristicPointEntityId], - [SurfaceLineEntityId], - [Type], - [X], - [Y], + [PipingCharacteristicPointEntityId], + [SurfaceLineEntityId], + [Type], + [X], + [Y], [Z]) SELECT - [CharacteristicPointEntityId], - [SurfaceLineEntityId], - [Type], - [X], - [Y], + [CharacteristicPointEntityId], + [SurfaceLineEntityId], + [Type], + [X], + [Y], [Z] FROM [SOURCEPROJECT].CharacteristicPointEntity; INSERT INTO ClosingStructureEntity ( @@ -1005,39 +1005,39 @@ INSERT INTO PipingStructureSectionResultEntity SELECT * FROM [SOURCEPROJECT].PipingStructureSectionResultEntity; INSERT INTO ProjectEntity SELECT * FROM [SOURCEPROJECT].ProjectEntity; INSERT INTO PipingSoilLayerEntity ( - [PipingSoilLayerEntityId], - [PipingSoilProfileEntityId], - [Top], - [IsAquifer], - [Color], - [MaterialName], - [BelowPhreaticLevelMean], - [BelowPhreaticLevelDeviation], - [BelowPhreaticLevelShift], - [DiameterD70Mean], - [DiameterD70CoefficientOfVariation], - [PermeabilityMean], - [PermeabilityCoefficientOfVariation], + [PipingSoilLayerEntityId], + [PipingSoilProfileEntityId], + [Top], + [IsAquifer], + [Color], + [MaterialName], + [BelowPhreaticLevelMean], + [BelowPhreaticLevelDeviation], + [BelowPhreaticLevelShift], + [DiameterD70Mean], + [DiameterD70CoefficientOfVariation], + [PermeabilityMean], + [PermeabilityCoefficientOfVariation], [Order]) -SELECT - [SoilLayerEntityId], - [SoilProfileEntityId], - [Top], - [IsAquifer], - CASE - WHEN [Color] IS 0 - THEN NULL - ELSE - [Color] - END, - [MaterialName], - [BelowPhreaticLevelMean], - [BelowPhreaticLevelDeviation], - [BelowPhreaticLevelShift], - [DiameterD70Mean], - [DiameterD70CoefficientOfVariation], - [PermeabilityMean], - [PermeabilityCoefficientOfVariation], +SELECT + [SoilLayerEntityId], + [SoilProfileEntityId], + [Top], + [IsAquifer], + CASE + WHEN [Color] IS 0 + THEN NULL + ELSE + [Color] + END, + [MaterialName], + [BelowPhreaticLevelMean], + [BelowPhreaticLevelDeviation], + [BelowPhreaticLevelShift], + [DiameterD70Mean], + [DiameterD70CoefficientOfVariation], + [PermeabilityMean], + [PermeabilityCoefficientOfVariation], [Order] FROM [SOURCEPROJECT].SoilLayerEntity; INSERT INTO PipingSoilProfileEntity ( @@ -1440,9 +1440,13 @@ INSERT INTO WaveImpactAsphaltCoverFailureMechanismMetaEntity ( [FailureMechanismEntityId], [ForeshoreProfileCollectionSourcePath]) -SELECT +SELECT [FailureMechanismEntityId], - CASE WHEN COUNT([ForeshoreProfileEntityId]) THEN "" ELSE NULL END + CASE + WHEN COUNT([ForeshoreProfileEntityId]) + THEN "" + ELSE NULL + END FROM [SOURCEPROJECT].FailureMechanismEntity LEFT JOIN [SOURCEPROJECT].ForeshoreProfileEntity USING (FailureMechanismEntityID) WHERE FailureMechanismType = 3 @@ -1538,6 +1542,81 @@ [LogMessage]) VALUES ("17.1", "17.2", "Gevolgen van de migratie van versie 17.1 naar versie 17.2:"); +CREATE TEMP TABLE TempLogOutputDeleted +( + 'NrDeleted' INTEGER NOT NULL +); + +INSERT INTO TempLogOutputDeleted SELECT COUNT() FROM [SOURCEPROJECT].ClosingStructuresOutputEntity; +INSERT INTO TempLogOutputDeleted SELECT COUNT() FROM [SOURCEPROJECT].DuneLocationOutputEntity; +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].GrassCoverErosionOutwardsHydraulicLocationOutputEntity; +INSERT INTO TempLogOutputDeleted SELECT COUNT() FROM [SOURCEPROJECT].GrassCoverErosionOutwardsWaveConditionsOutputEntity; +INSERT INTO TempLogOutputDeleted SELECT COUNT() FROM [SOURCEPROJECT].HeightStructuresOutputEntity; +INSERT INTO TempLogOutputDeleted SELECT COUNT() FROM [SOURCEPROJECT].HydraulicLocationOutputEntity; +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].PipingSemiProbabilisticOutputEntity + WHERE PipingCalculationEntityId IN ( + SELECT PipingCalculationEntityId + FROM [SOURCEPROJECT].PipingCalculationEntity + WHERE UseAssessmentLevelManualInput IS 0 + ); +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].PipingSemiProbabilisticOutputEntity + WHERE PipingCalculationEntityId IN ( + SELECT PipingCalculationEntityId + FROM [SOURCEPROJECT].PipingCalculationEntity + WHERE UseAssessmentLevelManualInput IS 1 + ); +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 + "17.1", + "17.2", + CASE + WHEN [NrRemaining] > 0 + THEN "* Alle berekende resultaten zijn verwijderd, behalve die van het toetsspoor 'Piping' waarbij het toetspeil 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 TempFailureMechanisms ( 'FailureMechanismType' INTEGER NOT NULL, Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/IntegrationTests/MigrationTo172IntegrationTest.cs =================================================================== diff -u -rae47ec1ec171e74d0eedf64cf0bcda742bc5f289 -r93776a3d8b9dcefa4e31ff43a2e6eb3bbd6e4cc0 --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/IntegrationTests/MigrationTo172IntegrationTest.cs (.../MigrationTo172IntegrationTest.cs) (revision ae47ec1ec171e74d0eedf64cf0bcda742bc5f289) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/IntegrationTests/MigrationTo172IntegrationTest.cs (.../MigrationTo172IntegrationTest.cs) (revision 93776a3d8b9dcefa4e31ff43a2e6eb3bbd6e4cc0) @@ -1162,11 +1162,14 @@ { ReadOnlyCollection messages = reader.GetMigrationLogMessages(); - Assert.AreEqual(49, messages.Count); + Assert.AreEqual(50, messages.Count); var i = 0; AssertMigrationLogMessageEqual( new MigrationLogMessage("17.1", newVersion, "Gevolgen van de migratie van versie 17.1 naar versie 17.2:"), messages[i++]); + AssertMigrationLogMessageEqual( + new MigrationLogMessage("17.1", newVersion, "* Alle berekende resultaten zijn verwijderd, behalve die van het toetsspoor 'Piping' waarbij het toetspeil handmatig is ingevuld."), + messages[i++]); AssertMigrationLogMessageEqual( new MigrationLogMessage("17.1", newVersion, "* Traject: 'assessmentSection'"),