Merge lp:~cjwatson/launchpad/db-livefs-keep-binary-files-interval into lp:launchpad/db-devel

Proposed by Colin Watson on 2019-06-12
Status: Merged
Merged at revision: 14098
Proposed branch: lp:~cjwatson/launchpad/db-livefs-keep-binary-files-interval
Merge into: lp:launchpad/db-devel
Diff against target: 14 lines (+10/-0)
1 file modified
database/schema/patch-2210-04-0.sql (+10/-0)
To merge this branch: bzr merge lp:~cjwatson/launchpad/db-livefs-keep-binary-files-interval
Reviewer Review Type Date Requested Status
William Grant db 2019-06-12 Approve on 2019-06-12
Stuart Bishop db 2019-06-12 Pending
Review via email:

Commit message

Add LiveFS.keep_binary_files_interval column.

Description of the change

I just set the default for the new column directly here, since there are only around 400 LiveFS rows on production. is the corresponding code change.

To post a comment you must log in.
William Grant (wgrant) wrote :

interval column, fancy. Also not very roundtrippable through JSON, but hopefully not a problem.

You've left the column nullable here, though the code expects it to be NOT NULL. But it seems like it's not totally unreasonable to allow NULL to disable pruning, given it's locked down.

review: Approve (db)
Colin Watson (cjwatson) wrote :

If by JSON you mean the webservice specifically, I dealt with that by only exposing a _days variant on the webservice. I did consider writing a timedelta marshaller, but for the web UI I think we want something simpler anyway.

Nullable was an oversight, but I guess you have a point; I'll see about adding that to the code branch.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'database/schema/patch-2210-04-0.sql'
2--- database/schema/patch-2210-04-0.sql 1970-01-01 00:00:00 +0000
3+++ database/schema/patch-2210-04-0.sql 2019-06-12 10:00:38 +0000
4@@ -0,0 +1,10 @@
5+-- Copyright 2019 Canonical Ltd. This software is licensed under the
6+-- GNU Affero General Public License version 3 (see the file LICENSE).
8+SET client_min_messages=ERROR;
10+ALTER TABLE LiveFS ADD COLUMN keep_binary_files_interval interval DEFAULT interval '1 day';
12+COMMENT ON COLUMN LiveFS.keep_binary_files_interval IS 'Keep binary files attached to builds of this live filesystem for at least this long.';
14+INSERT INTO LaunchpadDatabaseRevision VALUES (2210, 04, 0);


People subscribed via source and target branches

to status/vote changes: