[aur-dev] [PATCH 1/2] Save comment when closing requests

Lukas Fleischer lfleischer at archlinux.org
Sat Dec 12 17:38:13 UTC 2015


Signed-off-by: Lukas Fleischer <lfleischer at archlinux.org>
---
 schema/aur-schema.sql       | 1 +
 upgrading/4.2.0.txt         | 7 +++++++
 web/lib/pkgreqfuncs.inc.php | 3 ++-
 3 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/schema/aur-schema.sql b/schema/aur-schema.sql
index 5561278..f99833a 100644
--- a/schema/aur-schema.sql
+++ b/schema/aur-schema.sql
@@ -333,6 +333,7 @@ CREATE TABLE PackageRequests (
 	MergeBaseName VARCHAR(255) NULL,
 	UsersID INTEGER UNSIGNED NULL DEFAULT NULL,
 	Comments TEXT NOT NULL DEFAULT '',
+	ClosureComment TEXT NOT NULL DEFAULT '',
 	RequestTS BIGINT UNSIGNED NOT NULL DEFAULT 0,
 	Status TINYINT UNSIGNED NOT NULL DEFAULT 0,
 	PRIMARY KEY (ID),
diff --git a/upgrading/4.2.0.txt b/upgrading/4.2.0.txt
index 1450d5e..7482204 100644
--- a/upgrading/4.2.0.txt
+++ b/upgrading/4.2.0.txt
@@ -21,3 +21,10 @@ ALTER TABLE Users MODIFY Email VARCHAR(254) NOT NULL;
 ----
 ALTER TABLE PackageComments ADD COLUMN PinnedTS BIGINT UNSIGNED NOT NULL DEFAULT 0;
 ----
+
+
+3. Add new column to store the closure comment of package requests:
+
+----
+ALTER TABLE PackageRequests ADD COLUMN ClosureComment TEXT NOT NULL DEFAULT '';
+----
diff --git a/web/lib/pkgreqfuncs.inc.php b/web/lib/pkgreqfuncs.inc.php
index 3ea4692..c1a4931 100644
--- a/web/lib/pkgreqfuncs.inc.php
+++ b/web/lib/pkgreqfuncs.inc.php
@@ -227,7 +227,8 @@ function pkgreq_close($id, $reason, $comments, $auto_close=false) {
 		return array(false, __("Only TUs and developers can close requests."));
 	}
 
-	$q = "UPDATE PackageRequests SET Status = " . intval($status) . " ";
+	$q = "UPDATE PackageRequests SET Status = " . intval($status) . ", ";
+	$q.= "ClosureComment = " . $dbh->quote($comments) . " ";
 	$q.= "WHERE ID = " . intval($id);
 	$dbh->exec($q);
 
-- 
2.6.4


More information about the aur-dev mailing list