The collection details view doesn't distinguish "no retention of data" from "always retain all data"
I'm trying to tweak the data retention policy of a collection. Since we have no tools yet, I'm using SQL statements. I made my try on the collection linked below but it doesn't matter which one exactly, but I put the URL so that you can identify the view I'm referring to: https://debusine.debian.net/debian/base/collection/debian:environments/freexian/
By default the fields full_history_retention_period and metadata_only_retention_period have NULL values that are supposed to mean "keep the data forever". And that's shown on the website that way:
Corresponding SQL statement used (to reset the values to their initial values):
update db_collection set full_history_retention_period = NULL, metadata_only_retention_period = NULL where id = 62;
Then I tried to disable the data retention entirely by setting the duration to 0 days with this SQL statement:
update db_collection set full_history_retention_period = interval '0 days', metadata_only_retention_period = interval '0 days' where id = 62
The web view is the same (showing "Always") as the above screenshot. But the content of the database is definitely different:
debusine=# select c.id, c.name, c.category, w.name, c.full_history_retention_period as full, c.metadata_only_retention_period as metadata from db_collection as c, db_workspace as w where c.workspace_id = w.id and c.category = 'debian:environments';
id | name | category | name | full | metadata
----+----------+---------------------+------+----------+----------
5 | debian | debian:environments | base | |
62 | freexian | debian:environments | base | 00:00:00 | 00:00:00
However if I use a non-zero value like in this SQL statement:
update db_collection set full_history_retention_period = interval '1 days', metadata_only_retention_period = interval '1 days' where id = 62;
Then the view shows the correct delay:
Strangely when full_history_retention_period is set to 0 days, then the value of metadata_only_retention_period is not displayed properly. With this request:
update db_collection set full_history_retention_period = interval '0 days', metadata_only_retention_period = interval '1 days' where id = 62;
You get this: