Skip to content

Commit 42765fd

Browse files
authored
Merge pull request #8 from Adnanarodiya/main
Comments Functionality
2 parents 9cbe09d + 4783e0f commit 42765fd

18 files changed

+3149
-43
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
CREATE TABLE "app_comment" (
2+
"id" serial PRIMARY KEY NOT NULL,
3+
"userId" serial NOT NULL,
4+
"segmentId" serial NOT NULL,
5+
"content" text NOT NULL,
6+
"created_at" timestamp DEFAULT now() NOT NULL,
7+
"updated_at" timestamp DEFAULT now() NOT NULL
8+
);
9+
--> statement-breakpoint
10+
ALTER TABLE "app_comment" ADD CONSTRAINT "app_comment_userId_app_user_id_fk" FOREIGN KEY ("userId") REFERENCES "public"."app_user"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
11+
ALTER TABLE "app_comment" ADD CONSTRAINT "app_comment_segmentId_app_segment_id_fk" FOREIGN KEY ("segmentId") REFERENCES "public"."app_segment"("id") ON DELETE cascade ON UPDATE no action;

drizzle/0012_unusual_shiver_man.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ALTER TABLE "app_comment" ADD COLUMN "parentId" integer;--> statement-breakpoint
2+
ALTER TABLE "app_comment" ADD CONSTRAINT "app_comment_parentId_app_comment_id_fk" FOREIGN KEY ("parentId") REFERENCES "public"."app_comment"("id") ON DELETE cascade ON UPDATE no action;

drizzle/0013_black_vargas.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ALTER TABLE "app_comment" ADD COLUMN "repliedToId" integer;--> statement-breakpoint
2+
ALTER TABLE "app_comment" ADD CONSTRAINT "app_comment_repliedToId_app_user_id_fk" FOREIGN KEY ("repliedToId") REFERENCES "public"."app_user"("id") ON DELETE cascade ON UPDATE no action;

0 commit comments

Comments
 (0)