From a93363ac08ade0b17b342c5238efb37fc5d15741 Mon Sep 17 00:00:00 2001
From: Lukas Fleischer <archlinux@cryptocrack.de>
Date: Tue, 6 May 2014 20:52:32 +0200
Subject: Add a packager field to packages

Store the last packager in addition to storing the submitter and the
maintainer of a package. This allows for checking who last updated a
package, even if the package has been disowned.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
---
 schema/aur-schema.sql | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

(limited to 'schema/aur-schema.sql')

diff --git a/schema/aur-schema.sql b/schema/aur-schema.sql
index 8533548..adacdf0 100644
--- a/schema/aur-schema.sql
+++ b/schema/aur-schema.sql
@@ -104,16 +104,19 @@ CREATE TABLE PackageBases (
 	ModifiedTS BIGINT UNSIGNED NOT NULL,
 	SubmitterUID INTEGER UNSIGNED NULL DEFAULT NULL,     -- who submitted it?
 	MaintainerUID INTEGER UNSIGNED NULL DEFAULT NULL,    -- User
+	PackagerUID INTEGER UNSIGNED NULL DEFAULT NULL,      -- Last packager
 	PRIMARY KEY (ID),
 	UNIQUE (Name),
 	INDEX (CategoryID),
 	INDEX (NumVotes),
 	INDEX (SubmitterUID),
 	INDEX (MaintainerUID),
+	INDEX (PackagerUID),
 	FOREIGN KEY (CategoryID) REFERENCES PackageCategories(ID) ON DELETE NO ACTION,
 	-- deleting a user will cause packages to be orphaned, not deleted
 	FOREIGN KEY (SubmitterUID) REFERENCES Users(ID) ON DELETE SET NULL,
-	FOREIGN KEY (MaintainerUID) REFERENCES Users(ID) ON DELETE SET NULL
+	FOREIGN KEY (MaintainerUID) REFERENCES Users(ID) ON DELETE SET NULL,
+	FOREIGN KEY (PackagerUID) REFERENCES Users(ID) ON DELETE SET NULL
 ) ENGINE = InnoDB;
 
 
-- 
cgit v1.3.1

