mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
Add support for anonymous comments
This allows for removing users without also removing the corresponding comments. Instead, all comments from deleted users will be displayed as "Anonymous comment". Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
This commit is contained in:
parent
6ee1321211
commit
fb7bde3a6c
4 changed files with 33 additions and 8 deletions
|
@ -161,14 +161,14 @@ CREATE UNIQUE INDEX VoteUsersIDPackageID ON PackageVotes (UsersID, PackageID);
|
|||
CREATE TABLE PackageComments (
|
||||
ID BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
PackageID INTEGER UNSIGNED NOT NULL,
|
||||
UsersID INTEGER UNSIGNED NOT NULL,
|
||||
UsersID INTEGER UNSIGNED NULL DEFAULT NULL,
|
||||
Comments TEXT NOT NULL DEFAULT '',
|
||||
CommentTS BIGINT UNSIGNED NOT NULL DEFAULT 0,
|
||||
DelUsersID INTEGER UNSIGNED NULL DEFAULT NULL,
|
||||
PRIMARY KEY (ID),
|
||||
INDEX (UsersID),
|
||||
INDEX (PackageID),
|
||||
FOREIGN KEY (UsersID) REFERENCES Users(ID) ON DELETE CASCADE,
|
||||
FOREIGN KEY (UsersID) REFERENCES Users(ID) ON SET NULL,
|
||||
FOREIGN KEY (DelUsersID) REFERENCES Users(ID) ON DELETE CASCADE,
|
||||
FOREIGN KEY (PackageID) REFERENCES Packages(ID) ON DELETE CASCADE
|
||||
) ENGINE = InnoDB;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue