Permet de poster un commentaire sans être connecté

This commit is contained in:
2022-12-11 12:04:47 +01:00
parent 7596d26652
commit c2412de95a
8 changed files with 88 additions and 75 deletions

View File

@@ -20,7 +20,9 @@ CREATE TABLE comment (
news_id INT NOT NULL,
publication_date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
content TEXT NOT NULL,
author_id INT NOT NULL,
author_id INT NULL,
author_name VARCHAR(32) NULL,
CONSTRAINT either_authors CHECK ((author_id IS NULL) != (author_name IS NULL)),
FOREIGN KEY (news_id) REFERENCES news(id_news)
ON DELETE CASCADE,
FOREIGN KEY (author_id) REFERENCES registered_user(id_user)