Questions tagged [realm-migration]

Realm is a databasing system for iOS and Android mobile applications. Then a change is made in the database model it must be "Migrated" to the 'realm' for it to be incorporated into the database scheme.

Realm is a databasing system for iOS and Android mobile applications. When a change is made in the database model it must be "Migrated" to the 'realm' for it to be incorporated into the database scheme.

For information:
https://realm.io/docs/swift/latest/#migrations
https://realm.io/docs/swift/latest/api/

207 questions
3
votes
1 answer

Realm migration with new schema

I have an app which already taken use of a realm database. I now want to add a new RealmObject to the schema (say I want to add Person as my new RealmObject class). From the documentation it looks like I need to do the following to make this work: …
simen-andresen
  • 2,217
  • 4
  • 25
  • 39
3
votes
1 answer

Realm reset schema version

I'm currently in the process of writing an app that uses Realm as a database. As I'm still writing it my models have invariably changed from what I initially designed. Unfortunately every time this happens I need to update a migration block. Is…
TommyBs
  • 9,354
  • 4
  • 34
  • 65
3
votes
1 answer

Change Data Type from String to Long in Realm Android using RealmMigration

final RealmObjectSchema customerSchema = schema.get("Customer"); customerSchema.removeField("creditPeriod") .addField("creditPeriod", Long.class); Above is the code i used for realm migration. I have deleted the already existing field which was…
Ankur
  • 677
  • 1
  • 7
  • 21
3
votes
0 answers

Can I convert/cast a simple object to Realm object in JAVA?

I am writing a wrapper class in java for Realm. Can I convert Plain Object to RealmObject by having same names and data type of variables in the classes? For example public class Person { private String name; private int age; public…
Zahid Ali
  • 239
  • 5
  • 11
3
votes
1 answer

How to migrate data from realm when updating application

I'm new to Realm. I'm using realm as a local db, and if the app is updated i don't want to lose data. What i did earlier is public static Realm getRealmInstanse(){ RealmConfiguration config = new RealmConfiguration …
Jenya Kirmiza
  • 385
  • 1
  • 3
  • 12
3
votes
1 answer

How to update a type of a realm model property in Objective c?

I have a RLMObject in my Objective-c. I defined a property like: @property (assign, nonatomic) NSString *name; @property (assign, nonatomic) NSString *code; @property (assign, nonatomic) int day; @property (assign, nonatomic) int status; But…
user3745888
  • 6,143
  • 15
  • 48
  • 97
3
votes
1 answer

Realm support maven or having jar of it's latest source

I am having bit weird use case here, My project is divided in 2 modules one is server-project and another is android-app, Now they both are sharing same model classes. Server-project using maven build tool in eclipse and android-app using gradle in…
Bipin Vayalu
  • 3,025
  • 2
  • 25
  • 39
3
votes
2 answers

Perform Realm migration from one List to another

In my model I want to migrate a List where that Item holds a custom class product like: class Item: Object { dynamic var product: Product? } to simply a List I tried different things but nothing really seems to work. For example…
BObereder
  • 1,046
  • 1
  • 13
  • 29
3
votes
1 answer

Realm Migration: Migrate an object into a List

So, I've been trying to migrate my Realm schema, but I can't seem to do the following. In the oldSchema, I have the following: class Period: Object { dynamic var weekday: Weekday! // this is just another Realm Object } In the newSchema, I'm…
andyl
  • 83
  • 1
  • 5
3
votes
2 answers

Migrating, but still getting crash on 'RLMException', reason: 'Migration is required

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Realm, 1th thing { RLMRealmConfiguration *config = [RLMRealmConfiguration defaultConfiguration]; …
Peter Lapisu
  • 19,915
  • 16
  • 123
  • 179
3
votes
1 answer

RealmSwift Unit Test For Realm.io Migration

I need to write unit case for realm.io migration. How do i simulate a before and after Object Class?
perwyl
  • 323
  • 3
  • 14
2
votes
1 answer

Realm Swift Migration: String Wrapper List to String List

I am trying to migrate our Realm Swift schema from using a String wrapper class to the primitive String for collections. I am running into issues extracting the string values from the wrapper during migration. Here is the wrapper class: class…
Dan Schey
  • 101
  • 1
  • 5
2
votes
0 answers

Failed to transform received changeset: Schema mismatch: Property in class is nullable on one side and not on the other

I am trying to set up an android app with realm, but I get this error: Failed to transform received changeset: Schema mismatch: Property 'firstName' in class 'Customer' is nullable on one side and not on the other. Both in the android app and in the…
2
votes
0 answers

Schema changes to an active MongoDB Realm Sync

I'm new to MongoDB Realm and hence experimenting with it. From what I've seen is that I can't modify the Realm Schema (except for when in Development mode!) from the Realm UI without terminating and restarting the Realm Sync process. My concern is…
2
votes
1 answer

How to migration in realm for new table in android?

I add a new table to my realm database. For migration, I try at this way: realm.schema.create("AddTodoModel") .addField("id", Long::class.java, FieldAttribute.PRIMARY_KEY) .addField("title", String::class.java , FieldAttribute.INDEXED) …
Marlen Schreiner
  • 726
  • 10
  • 25
1 2
3
13 14