Reputation: 317
I'm developing an application with C++ (Qt) and SQLite. The app is installed with predefined database filled with some records. User has the ability to extend the database with his own records. I'm wondering how to achieve update of the app, i.e. when new version of app is being installed, I want to remove the old core (predefined) records in the database, and replace with (insert) the new ones. These questions arise:
Any ideas? Thanks
Upvotes: 2
Views: 322
Reputation: 811
Good question. I would go for the second option, since we did something similar here.
Another possibility would be to classify the data in the database, so you could know if the record is part of the system or is from the user (by using keywords or range of values, for example). Although this solution does not require additional tables or columns, it is much harder to understand and maintain, since it gives hidden meaning to the database records.
Upvotes: 0
Reputation: 808
There's a third variant:
This greatly simplifies queries (compared to the first variant) and you don't have the extra column which you don't need for most of the records (I think).
If you don't want the extra tables, I'd say do the second variant. The first one would force you to do your queries twice and UNION
them. That just doesn't sound right to me.
Upvotes: 2