Uploaded image for project: 'Realm Kotlin'
  1. Realm Kotlin
  2. RKOTLIN-225

SchemaMode::ResetFile does not trigger a hard reset

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Sync
    • None

      When implementing{{RealmConfiguration.deleteRealmIfMigrationRequired}} we discovered that ObjectStore SchemaMode::ResetFile is in fact a kind of "soft reset", i.e. if the schema changes are only adding or removing tables and indexes, these are applied to the existing file instead of a new file being created.

      This is somewhat problematic as the file might still contain old data. Currently, we are just documenting this in Dokka, but we should consider creating a SchemaMode:HardResetFile or similar which will reset the file on any migration.

      This will also enable a better behaviour for something like RealmConfiguation.initialData()

      Core feature: https://github.com/realm/realm-core/issues/4782

            Assignee:
            Unassigned Unassigned
            Reporter:
            unitosyncbot Unito Sync Bot
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: