← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~ilasc/launchpad:db-gitrepository-repack into launchpad:db-devel

 

Ioana Lasc has proposed merging ~ilasc/launchpad:db-gitrepository-repack into launchpad:db-devel.

Commit message:
GitRepository repack tresholds

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~ilasc/launchpad/+git/launchpad/+merge/396667

This adds the required fields on GitRepository for the Automated Git Repacks.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~ilasc/launchpad:db-gitrepository-repack into launchpad:db-devel.
diff --git a/database/schema/patch-2210-25-0.sql b/database/schema/patch-2210-25-0.sql
new file mode 100644
index 0000000..61d45a9
--- /dev/null
+++ b/database/schema/patch-2210-25-0.sql
@@ -0,0 +1,17 @@
+-- Copyright 2021 Canonical Ltd.  This software is licensed under the
+-- GNU Affero General Public License version 3 (see the file LICENSE).
+
+SET client_min_messages=ERROR;
+
+ALTER TABLE GitRepository
+    ADD COLUMN loose_objects integer DEFAULT 0 NOT NULL,
+    ADD COLUMN packs integer DEFAULT 0 NOT NULL,
+    ADD COLUMN date_last_repacked timestamp without time zone
+        DEFAULT NULL,
+    ADD COLUMN date_last_scanned timestamp without time zone
+        DEFAULT NULL;
+
+    COMMENT ON COLUMN GitRepository.date_last_scanned IS 'The datetime that packs and loose_objects were last updated for this repository.';
+    COMMENT ON COLUMN GitRepository.date_last_repacked IS 'The datetime that the last repack request was executed successfully on Turnip.';
+
+INSERT INTO LaunchpadDatabaseRevision VALUES (2210, 25, 0);
\ No newline at end of file