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

Automatic migration through many schema versions

      Hi, I'm making migration from Java SDK to Kotlin SDK. But firstly I need to make migration the old database and I'm wondering what is the proper way of migration through few schema versions
      For example:
      schema 1:

      class MyClass : RealmObject {
          val name: String? = null
          val count: Int? = null
      }
      

      schema 2:

      class MyClass : RealmObject {
          val name: String? = null
          val description: String? = null
          val count: Int? = null
          val size: Int? = null
      }
      

      schema 3:

      class MyClass : RealmObject {
          val name: String? = null
          val newNameOfDescription: String? = null
          val size: Int? = null
      }
      

      According to this docs https://www.mongodb.com/docs/realm-sdks/kotlin/1.0.2/library-base/-realm%20-kotlin%20-s-d-k/io.realm.kotlin.migration/-automatic-schema-migration/-migration-context/enumerate.html I should use enumerate but how exactly should I differentiate schema version is enumerate?

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

              Created:
              Updated:
              Resolved: