-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2f101d3
commit ce7255f
Showing
4 changed files
with
44 additions
and
0 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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
docker/postgres/data | ||
docker/pgadmin/ | ||
# Logs | ||
logs | ||
*.log | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
CREATE TABLE "follows" ( | ||
"following_user_id" integer NOT NULL, | ||
"followed_user_id" integer NOT NULL, | ||
"created_at" timestamp | ||
); | ||
|
||
CREATE TABLE "users" ( | ||
"id" integer PRIMARY KEY, | ||
"username" varchar NOT NULL, | ||
"password" varchar NOT NULL, | ||
"created_at" timestamp NOT NULL DEFAULT 'NOW()' | ||
); | ||
|
||
CREATE TABLE "posts" ( | ||
"id" integer PRIMARY KEY NOT NULL, | ||
"title" varchar NOT NULL, | ||
"body" text NOT NULL, | ||
"user_id" integer NOT NULL, | ||
"created_at" timestamp DEFAULT 'NOW()' | ||
); | ||
|
||
COMMENT ON COLUMN "posts"."body" IS 'Content of the post'; | ||
|
||
ALTER TABLE "posts" ADD FOREIGN KEY ("user_id") REFERENCES "users" ("id"); | ||
|
||
ALTER TABLE "follows" ADD FOREIGN KEY ("following_user_id") REFERENCES "users" ("id"); | ||
|
||
ALTER TABLE "follows" ADD FOREIGN KEY ("followed_user_id") REFERENCES "users" ("id"); |
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,7 @@ | ||
import { Router } from "express"; | ||
|
||
const router = Router() | ||
|
||
|
||
|
||
export default router |