CREATE TABLE "post_stats" (
	"post_id" uuid PRIMARY KEY NOT NULL,
	"views" integer NOT NULL,
	"shares" integer NOT NULL,
	"views_last_year" integer NOT NULL,
	"shares_last_year" integer NOT NULL
);
--> statement-breakpoint
ALTER TABLE "post_stats" ADD CONSTRAINT "post_stats_post_id_posts_id_fk" FOREIGN KEY ("post_id") REFERENCES "public"."posts"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
CREATE INDEX "post_stats_views_index" ON "post_stats" USING btree ("views");--> statement-breakpoint
CREATE INDEX "post_stats_views_last_year_index" ON "post_stats" USING btree ("views_last_year");--> statement-breakpoint
CREATE INDEX "post_stats_shares_index" ON "post_stats" USING btree ("shares");--> statement-breakpoint
CREATE INDEX "post_stats_shares_last_year_index" ON "post_stats" USING btree ("shares_last_year");