roscopeco / ormdroid

ORMDroid is a simple ORM persistence framework for your Android applications.
http://roscopeco.github.io/ormdroid/
Apache License 2.0
86 stars 24 forks source link

Database Upgrade/Migration #39

Open ChristopheCVB opened 10 years ago

ChristopheCVB commented 10 years ago

Are you thinking about implementing a way to be able to upgrade/migrate the database ?

I see 2 ways :

Of course, there are other ways to do that. What are your thoughts about it @roscopeco ?

roscopeco commented 10 years ago

I would love to implement something like this (it's been discussed a bit before). However, I'm not sure it would be best as part of the core lib, or as an add-on.

In any event, it's always been on the todo list, but not something I've gotten around to...

I like the script idea (a la rails migrations) but what language? I wouldn't want to bloat the core lib by including some kind of interpreter ideally...

ChristopheCVB commented 10 years ago

Yeah, the script idea is the best I think as it will be the most performant. I was thinking of SQL Scripts. Like seen in this [ http://stackoverflow.com/questions/4253804/insert-new-column-into-table-in-sqlite ] post. It will enable the developer to have full control.

But, it'd be so nice to allow database upgrade without the developer knowing it, just checking everything is fine, or if it's not, altering tables, and all of that programmatically... Anyway, it's not an easy (Table name change, Column name change...) and perfomant (Much more SQL request would be executed) solution, so I would stick to the first, which meet the needs.