-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: view schema with answers and comments
feat: vote answers
- Loading branch information
1 parent
673500b
commit 4147e84
Showing
9 changed files
with
689 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
CREATE TABLE answer_votes( | ||
id SERIAL PRIMARY KEY, | ||
answerid INT NOT NULL, | ||
userid INT NOT NULL, | ||
type TEXT NOT NULL, | ||
createdAt timestamp DEFAULT CURRENT_TIMESTAMP, | ||
updatedAt timestamp DEFAULT CURRENT_TIMESTAMP, | ||
FOREIGN KEY (answerid) REFERENCES forums_answers(id) ON DELETE CASCADE, | ||
FOREIGN KEY (userid) REFERENCES users(id) ON DELETE CASCADE, | ||
UNIQUE (answerid, userid) | ||
); | ||
|
||
|
||
CREATE TABLE community_events( | ||
id SERIAL PRIMARY KEY, | ||
userid INT NOT NULL, | ||
event_name TEXT, | ||
event_location TEXT, | ||
event_date timestamp, | ||
scope TEXT DEFAULT 'Private', --if private or public | ||
details TEXT, --description | ||
imagesrc TEXT, | ||
longitude DOUBLE PRECISION, | ||
latitude DOUBLE PRECISION, | ||
createdAt timestamp DEFAULT CURRENT_TIMESTAMP, | ||
updatedAt timestamp DEFAULT CURRENT_TIMESTAMP, | ||
status BOOLEAN DEFAULT TRUE, | ||
FOREIGN KEY (userid) REFERENCES users(id) ON DELETE CASCADE | ||
); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.