This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

semble / src / shared / infrastructure / database / migrations / 0016_ancient_cerise.sql
1.1 kB 19 lines
1CREATE TABLE "following_feed_items" ( 2 "user_id" text NOT NULL, 3 "activity_id" uuid NOT NULL, 4 "created_at" timestamp NOT NULL, 5 CONSTRAINT "following_feed_items_user_id_activity_id_pk" PRIMARY KEY("user_id","activity_id") 6); 7--> statement-breakpoint 8CREATE TABLE "follows" ( 9 "follower_id" text NOT NULL, 10 "target_id" text NOT NULL, 11 "target_type" text NOT NULL, 12 "created_at" timestamp DEFAULT now() NOT NULL, 13 CONSTRAINT "follows_follower_id_target_id_target_type_pk" PRIMARY KEY("follower_id","target_id","target_type") 14); 15--> statement-breakpoint 16ALTER TABLE "following_feed_items" ADD CONSTRAINT "following_feed_items_activity_id_feed_activities_id_fk" FOREIGN KEY ("activity_id") REFERENCES "public"."feed_activities"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint 17CREATE INDEX "idx_following_feed_user_time" ON "following_feed_items" USING btree ("user_id","created_at" DESC NULLS LAST);--> statement-breakpoint 18CREATE INDEX "idx_follows_follower" ON "follows" USING btree ("follower_id");--> statement-breakpoint 19CREATE INDEX "idx_follows_target" ON "follows" USING btree ("target_id","target_type");