Something went wrong. Try again.
Something went wrong. Try again.
12345678910111213CREATE TABLE "trail_posts" ( "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL, "trail_id" uuid NOT NULL, "author_id" uuid NOT NULL, "text" text NOT NULL, "facets" jsonb DEFAULT '[]'::jsonb NOT NULL, "created_at" timestamp with time zone DEFAULT now() NOT NULL);--> statement-breakpointALTER TABLE "trail_posts" ADD CONSTRAINT "trail_posts_trail_id_trails_id_fk" FOREIGN KEY ("trail_id") REFERENCES "public"."trails"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpointALTER TABLE "trail_posts" ADD CONSTRAINT "trail_posts_author_id_users_id_fk" FOREIGN KEY ("author_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpointCREATE INDEX "trail_posts_trail_created_idx" ON "trail_posts" USING btree ("trail_id","created_at");--> statement-breakpointCREATE INDEX "trail_posts_author_id_idx" ON "trail_posts" USING btree ("author_id");