Files
website/drizzle/20261026091249_cs_history/migration.sql

11 lines
466 B
SQL

CREATE TABLE "cs"."history_fetches" (
"item_id" integer,
"source" text,
"fetched_at" timestamp with time zone DEFAULT now() NOT NULL,
"points" integer DEFAULT 0 NOT NULL,
"first_day" date,
"error" text,
CONSTRAINT "history_fetches_pkey" PRIMARY KEY("item_id","source")
);
--> statement-breakpoint
ALTER TABLE "cs"."history_fetches" ADD CONSTRAINT "history_fetches_item_id_items_id_fkey" FOREIGN KEY ("item_id") REFERENCES "cs"."items"("id") ON DELETE CASCADE;