cache: add 'date' column in metadata_cache for history/by-date
Closes T2803.
Before, ls history/by-date/ took a few seconds and it was getting slower
the more metadata were stored in the sqlite cache. This was because it
would query the metadata cache for all SWHIDs in history.
Now, a new column has been created to store a relation (rev swhid, date)
meaning we only need to do one query to get all history with a specific
date prefix.