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: mp+368702@code.launchpad.net

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.

https://code.launchpad.net/~cjwatson/launchpad/livefs-keep-binary-files-interval/+merge/368703 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
=== added file 'database/schema/patch-2210-04-0.sql'
--- database/schema/patch-2210-04-0.sql 1970-01-01 00:00:00 +0000
+++ database/schema/patch-2210-04-0.sql 2019-06-12 10:00:38 +0000
@@ -0,0 +1,10 @@
1-- Copyright 2019 Canonical Ltd. This software is licensed under the
2-- GNU Affero General Public License version 3 (see the file LICENSE).
3
4SET client_min_messages=ERROR;
5
6ALTER TABLE LiveFS ADD COLUMN keep_binary_files_interval interval DEFAULT interval '1 day';
7
8COMMENT ON COLUMN LiveFS.keep_binary_files_interval IS 'Keep binary files attached to builds of this live filesystem for at least this long.';
9
10INSERT INTO LaunchpadDatabaseRevision VALUES (2210, 04, 0);

Subscribers

People subscribed via source and target branches

to status/vote changes: