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
63
63
}
64
64
65
65
override fun deleteRoom (roomId : RoomID ): Boolean = this .roomCollection.safeMongoDbWrite(defaultResult = false ) {
66
+ roomTimeSeriesCollection.deleteMany(
67
+ TimeSeriesRoomEnvironmentalData ::metadata / TimeSeriesRoomMetadata ::roomId eq roomId
68
+ )
66
69
deleteOne(Room ::id eq roomId).deletedCount > 0
67
70
}
68
71
@@ -121,6 +124,10 @@ class DatabaseManager(customConnectionString: String? = null) : RoomDatabaseMana
121
124
122
125
override fun deleteMedicalTechnology (medicalTechnologyId : MedicalTechnologyID ): Boolean =
123
126
this .medicalTechnologiesCollection.safeMongoDbWrite(defaultResult = false ) {
127
+ medicalTechnologyDataCollection.deleteMany(
128
+ TimeSeriesMedicalTechnologyUsage ::metadata /
129
+ TimeSeriesMedicalTechnologyMetadata ::medicalTechnologyId eq medicalTechnologyId
130
+ )
124
131
deleteOne(MedicalTechnology ::id eq medicalTechnologyId).deletedCount > 0
125
132
}
126
133
You can’t perform that action at this time.
0 commit comments