Commit 40ccf77c authored by Lukas Fleischer's avatar Lukas Fleischer
Browse files

Define "PackageComments.DelUsersID" as "NULL".


Signed-off-by: default avatarLukas Fleischer <archlinux@cryptocrack.de>
parent ac632980
......@@ -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
......
......@@ -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),
......
......@@ -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'])) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment