summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Fleischer <archlinux@cryptocrack.de>2011-02-27 16:16:40 +0100
committerLukas Fleischer <archlinux@cryptocrack.de>2011-02-27 16:20:02 +0100
commit40ccf77ca0c6745d8b75e925e915cdf51a924312 (patch)
tree53bb39caebf188f509bbdce6b735f6868db91658
parentac632980c3789cd99a80d61861b8820ddad14704 (diff)
downloadaur-40ccf77ca0c6745d8b75e925e915cdf51a924312.tar.gz
aur-40ccf77ca0c6745d8b75e925e915cdf51a924312.tar.xz
Define "PackageComments.DelUsersID" as "NULL".
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
-rw-r--r--UPGRADING3
-rw-r--r--support/schema/aur-schema.sql2
-rw-r--r--web/lib/pkgfuncs.inc4
3 files changed, 6 insertions, 3 deletions
diff --git a/UPGRADING b/UPGRADING
index 72274793..4a6aec4b 100644
--- a/UPGRADING
+++ b/UPGRADING
@@ -25,6 +25,9 @@ ALTER TABLE TU_VoteInfo
ALTER TABLE TU_Votes
ADD FOREIGN KEY (VoteID) REFERENCES TU_VoteInfo(ID) ON DELETE CASCADE,
ADD FOREIGN KEY (UserID) REFERENCES Users(ID) ON DELETE CASCADE;
+ALTER TABLE PackageComments
+ MODIFY DelUsersID INTEGER UNSIGNED NULL DEFAULT NULL;
+UPDATE PackageComments SET DelUsersID = NULL WHERE DelUsersID = 0;
----
From 1.7.0 to 1.8.0
diff --git a/support/schema/aur-schema.sql b/support/schema/aur-schema.sql
index fbed3a4c..be1296a7 100644
--- a/support/schema/aur-schema.sql
+++ b/support/schema/aur-schema.sql
@@ -161,7 +161,7 @@ CREATE TABLE PackageComments (
UsersID INTEGER UNSIGNED NOT NULL,
Comments TEXT NOT NULl DEFAULT '',
CommentTS BIGINT UNSIGNED NOT NULL DEFAULT 0,
- DelUsersID INTEGER UNSIGNED NOT NULL DEFAULT 0,
+ DelUsersID INTEGER UNSIGNED NULL DEFAULT NULL,
PRIMARY KEY (ID),
INDEX (UsersID),
INDEX (PackageID),
diff --git a/web/lib/pkgfuncs.inc b/web/lib/pkgfuncs.inc
index 53868b64..6da29b4c 100644
--- a/web/lib/pkgfuncs.inc
+++ b/web/lib/pkgfuncs.inc
@@ -181,7 +181,7 @@ function package_comments_count($pkgid = 0) {
$dbh = db_connect();
$q = "SELECT COUNT(*) FROM PackageComments ";
$q.= "WHERE PackageID = " . mysql_real_escape_string($pkgid);
- $q.= " AND DelUsersID = 0";
+ $q.= " AND DelUsersID IS NULL";
}
$result = db_query($q, $dbh);
@@ -201,7 +201,7 @@ function package_comments($pkgid = 0) {
$q.= "FROM PackageComments, Users ";
$q.= "WHERE PackageComments.UsersID = Users.ID";
$q.= " AND PackageID = ".mysql_real_escape_string($pkgid);
- $q.= " AND DelUsersID = 0"; # only display non-deleted comments
+ $q.= " AND DelUsersID IS NULL"; # only display non-deleted comments
$q.= " ORDER BY CommentTS DESC";
if (!isset($_GET['comments'])) {