Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

252
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda