fix: old sessions (#218)

* fix: old sessions

* fix: old sessions

---------

Co-authored-by: Florent Champigny <florent@bere.al>
This commit is contained in:
Florent CHAMPIGNY 2025-09-11 15:05:10 +02:00 committed by GitHub
parent 1b207d614b
commit 222b901833
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -4,6 +4,8 @@ import androidx.room.Dao
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import androidx.room.Update
import androidx.room.Upsert
import io.github.openflocon.data.local.device.datasource.model.DeviceAppEntity
import io.github.openflocon.data.local.device.datasource.model.DeviceEntity
import io.github.openflocon.domain.device.models.DeviceId
@ -21,10 +23,10 @@ interface DevicesDao {
@Query("SELECT * FROM DeviceEntity WHERE deviceId = :deviceId")
suspend fun getDeviceById(deviceId: String): DeviceEntity?
@Insert(onConflict = OnConflictStrategy.REPLACE)
@Upsert
suspend fun insertDevice(device: DeviceEntity)
@Insert(onConflict = OnConflictStrategy.REPLACE)
@Upsert
suspend fun insertDeviceApp(app: DeviceAppEntity)
@Query("DELETE FROM DeviceEntity")