CREATE TABLE "TenantMetric" (
  "id" TEXT NOT NULL,
  "tenantId" TEXT NOT NULL,
  "avgProcessingRate" DOUBLE PRECISION,
  "sampleCount" INTEGER NOT NULL DEFAULT 0,
  "updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,

  CONSTRAINT "TenantMetric_pkey" PRIMARY KEY ("id")
);

CREATE UNIQUE INDEX "TenantMetric_tenantId_key" ON "TenantMetric"("tenantId");

ALTER TABLE "TenantMetric"
ADD CONSTRAINT "TenantMetric_tenantId_fkey"
FOREIGN KEY ("tenantId") REFERENCES "Tenant"("id")
ON DELETE CASCADE ON UPDATE CASCADE;
