-- CreateTable
CREATE TABLE "EmploymentOffice" (
    "id" TEXT NOT NULL,
    "name" TEXT NOT NULL,
    "nameEN" TEXT NOT NULL,
    "provinceId" TEXT NOT NULL,

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

-- CreateTable
CREATE TABLE "EmploymentOfficeDistrict" (
    "areaId" TEXT NOT NULL,
    "districtId" TEXT NOT NULL,

    CONSTRAINT "EmploymentOfficeDistrict_pkey" PRIMARY KEY ("areaId","districtId")
);

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

-- AddForeignKey
ALTER TABLE "EmploymentOfficeDistrict" ADD CONSTRAINT "EmploymentOfficeDistrict_areaId_fkey" FOREIGN KEY ("areaId") REFERENCES "EmploymentOffice"("id") ON DELETE RESTRICT ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "EmploymentOfficeDistrict" ADD CONSTRAINT "EmploymentOfficeDistrict_districtId_fkey" FOREIGN KEY ("districtId") REFERENCES "District"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
