-- CreateTable
CREATE TABLE "lab_rx_template" (
    "id" SERIAL NOT NULL,
    "userId" INTEGER NOT NULL,
    "name" TEXT NOT NULL,
    "labName" TEXT,
    "labPhone" TEXT,
    "labFax" TEXT,
    "labAddress" TEXT,
    "labAccount" TEXT,
    "caseType" TEXT,
    "material" TEXT,
    "instructions" TEXT,
    "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updatedAt" TIMESTAMP(3) NOT NULL,

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

-- CreateIndex
CREATE INDEX "lab_rx_template_userId_idx" ON "lab_rx_template"("userId");

-- AddForeignKey
ALTER TABLE "lab_rx_template" ADD CONSTRAINT "lab_rx_template_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
