Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

243
Views
Do I need a migration to change type Int to Long?

There is a birthday field in my RealmObject class which is a type of Int?. I need to change this field's type to Long?. I don't know whether I would need a migration or not.

From realm docs :

The integer types byte, short, int, and long are all mapped to long within Realm.

I have tried to install a version of the app without deleteRealmIfMigrationNeeded (meaning that Realm will try to do a migration if needed) on emulator and then changed the field from Int? to Long?. No crashes or exceptions. Also when I pulled my realm file from emulator, field's type stayed the same and still is Int?.

open class Profile : RealmObject() {

    @PrimaryKey
    var id = ""
    var email = ""
    var firstName = ""
    var lastName = ""
    var dateJoined = 0
    var gender: String? = null
    var birthday: Int? = null // I want to change this to Long?
}

What I am expecting is that I will need no migrations for this scenario. But I don't want to push the update without getting a real answer.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

It is confirmed that there is no migration needed for this case. Do I need a migration to change type Int to Long?

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!