CREATE TABLE "public"."media_analytics_detail" ("id" uuid NOT NULL DEFAULT gen_random_uuid(), "created_at" timestamptz NOT NULL DEFAULT now(), "media_analytics_id" uuid NOT NULL, "jobid" uuid NOT NULL, "bodyshopid" uuid NOT NULL, "document_count" integer NOT NULL, "total_size_bytes" integer NOT NULL, "file_type_stats" jsonb NOT NULL DEFAULT jsonb_build_object(), PRIMARY KEY ("id") , FOREIGN KEY ("media_analytics_id") REFERENCES "public"."media_analytics"("id") ON UPDATE restrict ON DELETE restrict, FOREIGN KEY ("jobid") REFERENCES "public"."jobs"("id") ON UPDATE restrict ON DELETE restrict, FOREIGN KEY ("bodyshopid") REFERENCES "public"."bodyshops"("id") ON UPDATE restrict ON DELETE restrict);
CREATE EXTENSION IF NOT EXISTS pgcrypto;
