For a typical todolist app where you have the user has the ability to add a new list on the fly, how would I accomplish that with a SQLite database? I could add a column to the table of todo objects that indicate which list the todo is a part of. However, that seems negligibly inefficient and structurally bad. What I think I would like is to create a table for every list. But how would that work? Increment the DB Version and call onUpgrade() every time a user wants to add a new table? Then if I want to make a structural change to a todolist table I have to iterate over however many tables there are and then make the structural change?
I feel like there is a cleaner way to do this and I would appreciate if someone could point me in the right direction as I am a beginner at this.
Thanks!
Aucun commentaire:
Enregistrer un commentaire