You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using RealmDb in a Flutter App Project, in my configuration, I am only doing a local storage to the device and no cloud syncing,
final config = Configuration.local([
//
]);
final realm = Realm(config);
I did changes to my model, and RealmDb says I need to migrate, I was hoping there would be a command to get that done but I haven't seen anything like that,
I saw this but it doesn't help much in my situation, https://www.mongodb.com/developer/products/realm/realm-schema-migration/
My last resort would be to delete the local db (wherever, I will find it and what ever it looks like) and regenerating the schema again, which by the way doesn't work because it seems RealmDB is using the already created Db, if I knew at which point of the configuration that Db was created it would have been helpful but I don't know.
I was hoping that by dart run realm generate creates the Db so if I deleted it a new one would be created but nope!
How do I do migrations in a local config setup ?
Solution
Can we have something like dart run realm migrate?
This could run dart run realm generate under the hood, (I saw this based on how I a small part of realm generate works) there could be a gazillion reasons why realm migrate shouldn't run it under the hood but what I am hoping to say is to have realm migrate rebuild the schema replacing {{ schemas.g.dart}} and updating the Db for everything to just work.
If this can not be done I hope to learn why and what are the work arounds, I would really know to learn, thanks.
Alternatives
I have seen documentation on adding a schema version in the configuration, I haven't seen one that is well written and talks about how to manage that in local configurations, a good documentation on how to do that with local configuration would help tremendously for the time been.
How important is this improvement for you?
Would be a major improvement
Feature would mainly be used with
Local Database only
The text was updated successfully, but these errors were encountered:
It would be great to add a resource like this in the Error Message that appears in VS Code that tells the developer that they need to do a Migration.
rasheedmhd
changed the title
How do I do Migrations in a local first RealmDb Configuration?
Doing Migrations in a local first RealmDb Configuration
Dec 24, 2023
rasheedmhd
changed the title
Doing Migrations in a local first RealmDb Configuration
Creating Migrations in a local first RealmDb Configuration
Dec 24, 2023
Problem
I am using RealmDb in a Flutter App Project, in my configuration, I am only doing a local storage to the device and no cloud syncing,
I did changes to my model, and RealmDb says I need to migrate, I was hoping there would be a command to get that done but I haven't seen anything like that,
I saw this but it doesn't help much in my situation, https://www.mongodb.com/developer/products/realm/realm-schema-migration/
My last resort would be to delete the local db (wherever, I will find it and what ever it looks like) and regenerating the schema again, which by the way doesn't work because it seems RealmDB is using the already created Db, if I knew at which point of the configuration that Db was created it would have been helpful but I don't know.
I was hoping that by
dart run realm generate
creates the Db so if I deleted it a new one would be created but nope!How do I do migrations in a local config setup ?
Solution
Can we have something like
dart run realm migrate
?This could run
dart run realm generate
under the hood, (I saw this based on how I a small part of realm generate works) there could be a gazillion reasons whyrealm migrate
shouldn't run it under the hood but what I am hoping to say is to haverealm migrate
rebuild the schema replacing {{ schemas.g.dart}} and updating the Db for everything to just work.If this can not be done I hope to learn why and what are the work arounds, I would really know to learn, thanks.
Alternatives
I have seen documentation on adding a schema version in the configuration, I haven't seen one that is well written and talks about how to manage that in local configurations, a good documentation on how to do that with local configuration would help tremendously for the time been.
How important is this improvement for you?
Would be a major improvement
Feature would mainly be used with
Local Database only
The text was updated successfully, but these errors were encountered: