Skip to content

Commit

Permalink
feat: Delete Realm when migration is needed
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinBoulongne committed Oct 17, 2024
1 parent dc634d8 commit 9c064b9
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,21 @@ class RealmProvider(private val loadDataInMemory: Boolean = false) {
private val realmAppSettingsConfiguration = RealmConfiguration
.Builder(schema = setOf(AppSettingsDB::class))
.name("AppSettings")
.deleteRealmIfMigrationNeeded() // TODO: Remove before going to production !
.loadDataInMemoryIfNeeded()
.build()

private val realmUploadDBConfiguration = RealmConfiguration
.Builder(schema = setOf(UploadDB::class, UploadContainerDB::class, UploadFileDB::class))
.name("Uploads")
.deleteRealmIfMigrationNeeded() // TODO: Remove before going to production !
.loadDataInMemoryIfNeeded()
.build()

private fun realmTransfersConfiguration(userId: Int) = RealmConfiguration
.Builder(schema = setOf(TransferDB::class, ContainerDB::class, FileDB::class))
.name(transferRealmName(userId))
.deleteRealmIfMigrationNeeded() // TODO: Remove before going to production !
.loadDataInMemoryIfNeeded()
.build()

Expand Down

0 comments on commit 9c064b9

Please sign in to comment.