File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
src/main/kotlin/infrastructure/database Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,9 @@ class DatabaseManager(customConnectionString: String? = null) : RoomDatabaseMana
6363 }
6464
6565 override fun deleteRoom (roomId : RoomID ): Boolean = this .roomCollection.safeMongoDbWrite(defaultResult = false ) {
66+ roomTimeSeriesCollection.deleteMany(
67+ TimeSeriesRoomEnvironmentalData ::metadata / TimeSeriesRoomMetadata ::roomId eq roomId
68+ )
6669 deleteOne(Room ::id eq roomId).deletedCount > 0
6770 }
6871
@@ -121,6 +124,10 @@ class DatabaseManager(customConnectionString: String? = null) : RoomDatabaseMana
121124
122125 override fun deleteMedicalTechnology (medicalTechnologyId : MedicalTechnologyID ): Boolean =
123126 this .medicalTechnologiesCollection.safeMongoDbWrite(defaultResult = false ) {
127+ medicalTechnologyDataCollection.deleteMany(
128+ TimeSeriesMedicalTechnologyUsage ::metadata /
129+ TimeSeriesMedicalTechnologyMetadata ::medicalTechnologyId eq medicalTechnologyId
130+ )
124131 deleteOne(MedicalTechnology ::id eq medicalTechnologyId).deletedCount > 0
125132 }
126133
You can’t perform that action at this time.
0 commit comments