-- CreateTable
CREATE TABLE "ElectedMember" (
    "id" TEXT NOT NULL,
    "image" TEXT,
    "fullName" VARCHAR(250) NOT NULL,
    "positionId" TEXT NOT NULL,
    "activityFamilyId" TEXT NOT NULL,
    "activityId" TEXT NOT NULL,
    "phoneNumber" VARCHAR(250) NOT NULL,
    "gsm" VARCHAR(250) NOT NULL,
    "fax" VARCHAR(250) NOT NULL,
    "email" VARCHAR(250) NOT NULL,
    "adresse" VARCHAR(250) NOT NULL,
    "collegeId" TEXT NOT NULL,
    "provinceId" TEXT NOT NULL,
    "mandateId" TEXT NOT NULL,
    "commissions" TEXT[],
    "details" TEXT NOT NULL,

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

-- AddForeignKey
ALTER TABLE "ElectedMember" ADD CONSTRAINT "ElectedMember_positionId_fkey" FOREIGN KEY ("positionId") REFERENCES "Position"("id") ON DELETE RESTRICT ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "ElectedMember" ADD CONSTRAINT "ElectedMember_activityFamilyId_fkey" FOREIGN KEY ("activityFamilyId") REFERENCES "ActivityFamily"("id") ON DELETE RESTRICT ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "ElectedMember" ADD CONSTRAINT "ElectedMember_activityId_fkey" FOREIGN KEY ("activityId") REFERENCES "Activity"("id") ON DELETE RESTRICT ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "ElectedMember" ADD CONSTRAINT "ElectedMember_collegeId_fkey" FOREIGN KEY ("collegeId") REFERENCES "College"("id") ON DELETE RESTRICT ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "ElectedMember" ADD CONSTRAINT "ElectedMember_provinceId_fkey" FOREIGN KEY ("provinceId") REFERENCES "Province"("id") ON DELETE RESTRICT ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "ElectedMember" ADD CONSTRAINT "ElectedMember_mandateId_fkey" FOREIGN KEY ("mandateId") REFERENCES "Mandate"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
