I have a problem with the design of a database: In my Android application i need to store the upload (the status, so if the file is in upload it will report the % of the upload) of a file and a list of all files uploaded.
First, i was design the database to something like this:
Files ---------------- _id INT PK, status INT, progress INT, imageupload BLOB
status will be the status of the upload which will be
0. Unknown 1. In upload 2. Error 3. Success
imageupload is just a class serializable which contains:
imagesUri (A List),
(i said that in case exists another better way to design it which i didn't know and avoid using a blob)
With this design i could see if a file is in upload by reading the status
WHERE status != 3 AND status != 2
Another design which could be used is to use two tables where in one table are stored the in upload files and in another the already uploaded.
With the two tables i avoid using
status but it will let me execute two queries inside to select all files and order them by
What is the best practice? Is one table prefered over two tables? I would use one table since it's more easy and can be edited without problems. With the second version i should move the record from
in_upload table to
uploaded table (which could be problematic).
If it's important i'm using