Store current date and time when deleting comments

Instead of modifying EditedTS when a comment is deleted, use a separate
field DelTS. Use this field to determine whether a comment has been
deleted, instead of checking DelUsersID which might be unset when the
corresponding user is deleted.

Fixes FS#47362.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
This commit is contained in:
Lukas Fleischer 2015-12-13 20:57:06 +01:00
parent 9abd44671d
commit 51407d4a29
4 changed files with 36 additions and 22 deletions

View file

@ -260,6 +260,7 @@ CREATE TABLE PackageComments (
CommentTS BIGINT UNSIGNED NOT NULL DEFAULT 0,
EditedTS BIGINT UNSIGNED NULL DEFAULT NULL,
EditedUsersID INTEGER UNSIGNED NULL DEFAULT NULL,
DelTS BIGINT UNSIGNED NULL DEFAULT NULL,
DelUsersID INTEGER UNSIGNED NULL DEFAULT NULL,
PinnedTS BIGINT UNSIGNED NOT NULL DEFAULT 0,
PRIMARY KEY (ID),