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

Proposed by Colin Watson
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 Approve
Stuart Bishop db 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.
Revision history for this message
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)
Revision history for this message
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).
7+
8+SET client_min_messages=ERROR;
9+
10+ALTER TABLE LiveFS ADD COLUMN keep_binary_files_interval interval DEFAULT interval '1 day';
11+
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.';
13+
14+INSERT INTO LaunchpadDatabaseRevision VALUES (2210, 04, 0);

Subscribers

People subscribed via source and target branches

to status/vote changes: