-- CreateTable
CREATE TABLE "vendor_histories" (
    "id" TEXT NOT NULL,
    "hospital_id" TEXT NOT NULL,
    "vendor_id" TEXT NOT NULL,
    "vendor_impression" TEXT,
    "status" TEXT,
    "contract_date" TIMESTAMP(3),
    "contract_expired_date" TIMESTAMP(3),
    "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updatedAt" TIMESTAMP(3) NOT NULL,
    "deletedAt" TIMESTAMP(3),

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

-- AddForeignKey
ALTER TABLE "vendor_histories" ADD CONSTRAINT "vendor_histories_hospital_id_fkey" FOREIGN KEY ("hospital_id") REFERENCES "hospitals"("id") ON DELETE RESTRICT ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "vendor_histories" ADD CONSTRAINT "vendor_histories_vendor_id_fkey" FOREIGN KEY ("vendor_id") REFERENCES "vendors"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
