-- AlterTable
ALTER TABLE "Appointment" ADD COLUMN     "procedureCodeNotes" TEXT;

-- CreateTable
CREATE TABLE "NpiProvider" (
    "id" SERIAL NOT NULL,
    "userId" INTEGER NOT NULL,
    "npiNumber" TEXT NOT NULL,
    "providerName" TEXT NOT NULL,
    "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,

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

-- CreateIndex
CREATE INDEX "NpiProvider_userId_idx" ON "NpiProvider"("userId");

-- CreateIndex
CREATE UNIQUE INDEX "NpiProvider_userId_npiNumber_key" ON "NpiProvider"("userId", "npiNumber");

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