/*
  Warnings:

  - You are about to drop the column `feedback_question_id` on the `programme_feedback` table. All the data in the column will be lost.
  - You are about to drop the column `districtId` on the `user` table. All the data in the column will be lost.
  - Added the required column `working_district_id` to the `candidate` table without a default value. This is not possible if the table is not empty.
  - Made the column `name_title` on table `candidate` required. This step will fail if there are existing NULL values in that column.
  - Added the required column `programme_feedback_question_id` to the `programme_feedback` table without a default value. This is not possible if the table is not empty.
  - Added the required column `programme_session_feedback_question_id` to the `session_feedBack` table without a default value. This is not possible if the table is not empty.

*/
-- DropForeignKey
ALTER TABLE "programme_feedback" DROP CONSTRAINT "programme_feedback_feedback_question_id_fkey";

-- DropForeignKey
ALTER TABLE "session_feedBack" DROP CONSTRAINT "session_feedBack_feedback_question_id_fkey";

-- DropForeignKey
ALTER TABLE "user" DROP CONSTRAINT "user_districtId_fkey";

-- AlterTable
ALTER TABLE "candidate" ADD COLUMN     "working_district_id" TEXT NOT NULL,
ALTER COLUMN "name_title" SET NOT NULL;

-- AlterTable
ALTER TABLE "programme_feedback" DROP COLUMN "feedback_question_id",
ADD COLUMN     "feedback_questionId" TEXT,
ADD COLUMN     "programme_feedback_question_id" TEXT NOT NULL;

-- AlterTable
ALTER TABLE "session_feedBack" ADD COLUMN     "feedback_questionId" TEXT,
ADD COLUMN     "programme_session_feedback_question_id" TEXT NOT NULL;

-- AlterTable
ALTER TABLE "user" DROP COLUMN "districtId",
ADD COLUMN     "district_id" TEXT;

-- AddForeignKey
ALTER TABLE "user" ADD FOREIGN KEY ("district_id") REFERENCES "district"("id") ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "candidate" ADD FOREIGN KEY ("working_district_id") REFERENCES "district"("id") ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "session_feedBack" ADD FOREIGN KEY ("programme_session_feedback_question_id") REFERENCES "programme_session_feedback_question"("id") ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "session_feedBack" ADD FOREIGN KEY ("feedback_questionId") REFERENCES "feedback_question"("id") ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "programme_feedback" ADD FOREIGN KEY ("programme_feedback_question_id") REFERENCES "programme_feedback_question"("id") ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "programme_feedback" ADD FOREIGN KEY ("feedback_questionId") REFERENCES "feedback_question"("id") ON DELETE SET NULL ON UPDATE CASCADE;
