implemented following users to receive (opt-in) email notifications when they publish an article.
This commit is contained in:
@@ -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');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user