implemented following users to receive (opt-in) email notifications when they publish an article.

This commit is contained in:
2025-04-14 22:32:32 -06:00
parent fdcc1a3349
commit 420022dbf8
11 changed files with 248 additions and 82 deletions
+10
View File
@@ -60,6 +60,16 @@ CREATE TABLE article_tags (
FOREIGN KEY (tag_id) REFERENCES tags(tag_id)
);
CREATE TABLE follows (
follower_user_id INT NOT NULL,
following_user_id INT NOT NULL,
notify_user BOOLEAN DEFAULT FALSE,
followed_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (follower_user_id, following_user_id),
FOREIGN KEY (follower_user_id) REFERENCES user(user_id) ON DELETE CASCADE,
FOREIGN KEY (following_user_id) REFERENCES user(user_id) ON DELETE CASCADE
);
INSERT INTO roles (role)
VALUES ('owner'), ('admin'), ('contributor'), ('reader');