New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some Migration Questions #778
Comments
Hi @wilberolive,
using(var db = new LiteDatabase("..."))
You can also run shell commands to update your data without write any code. It's ideal when you have a single database to update. You can run
Shell command also supported using I will add more options in shell and then will write a wiki page |
Thanks for all the info. Will try all this out. Unfortunately I cannot use the Shell and have to do it through code as the database will reside on individual client machines that I don't have direct access to once the app is deployed. So anytime the data changes, I need the app itself to manage those changes and keep its own database updated. |
@wilberolive, you can use shell commands inside your code using |
Hi! With the objective of organizing our issues, we are closing old unsolved issues. Please check the latest version of LiteDB and open a new issue if your problem/question/suggestion still applies. Thanks! |
This answer does not fit into current version of database (nuget package v 5.0.17). |
Hi I'm just wondering how I handle some simple migration scenarios when the data structure changes.
I found this, which talks about changing a data type of a field. However the code seems to be different now and requires some sort of query. Is this still a valid solution for changing a field's data type?
How do you handle changing the name of a field? So for example, I have a collection of items and the items class has a property called Price. However I would like to rename that property to Cost for example.
How do you remove a field? Say if I remove the Price property entirely from the items class. I notice that the column seems to stay in the database. Can I remove the column somehow?
I'm also wondering what happens if you change the order of properties within a collection's class. Does that matter at all?
I think you should add a page to the wiki that covers all of the common migration scenarios as it would be a common problem for any real world application.
The text was updated successfully, but these errors were encountered: