text: /*
    Warnings:
  
    - The primary key for the `QuestionResult` table will be changed. If it partially fails, the table could be left without primary key constraint.
    - The primary key for the `Student` table will be changed. If it partially fails, the table could be left without primary key constraint.
    - The primary key for the `Teacher` table will be changed. If it partially fails, the table could be left without primary key constraint.
    - The primary key for the `User` table will be changed. If it partially fails, the table could be left without primary key constraint.
    - Added the required column `role` to the `Teacher` table without a default value. This is not possible if the table is not empty.
  
  */
  -- DropForeignKey
  ALTER TABLE "QuestionResult" DROP CONSTRAINT "QuestionResult_studentID_fkey";
  
  -- DropForeignKey
  ALTER TABLE "Student" DROP CONSTRAINT "Student_id_fkey";
  
  -- DropForeignKey
  ALTER TABLE "Teacher" DROP CONSTRAINT "Teacher_id_fkey";
  
  -- AlterTable
  ALTER TABLE "Course" ADD COLUMN     "teacherID" TEXT,
  ALTER COLUMN "ploGroupID" DROP NOT NULL;
  
  -- AlterTable
  ALTER TABLE "Program" ADD COLUMN     "teacherID" TEXT;
  
  -- AlterTable
  ALTER TABLE "QuestionResult" DROP CONSTRAINT "QuestionResult_pkey",
  ALTER COLUMN "studentID" SET DATA TYPE TEXT,
  ADD CONSTRAINT "QuestionResult_pkey" PRIMARY KEY ("questionID", "studentID");
  
  -- AlterTable
  ALTER TABLE "Student" DROP CONSTRAINT "Student_pkey",
  ALTER COLUMN "id" SET DATA TYPE TEXT,
  ADD CONSTRAINT "Student_pkey" PRIMARY KEY ("id");
  
  -- AlterTable
  ALTER TABLE "Teacher" DROP CONSTRAINT "Teacher_pkey",
  ADD COLUMN     "role" INTEGER NOT NULL,
  ALTER COLUMN "id" SET DATA TYPE TEXT,
  ADD CONSTRAINT "Teacher_pkey" PRIMARY KEY ("id");
  
  -- AlterTable
  ALTER TABLE "User" DROP CONSTRAINT "User_pkey",
  ALTER COLUMN "id" SET DATA TYPE TEXT,
  ADD CONSTRAINT "User_pkey" PRIMARY KEY ("id");
  
  -- AddForeignKey
  ALTER TABLE "Student" ADD CONSTRAINT "Student_id_fkey" FOREIGN KEY ("id") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
  
  -- AddForeignKey
  ALTER TABLE "Teacher" ADD CONSTRAINT "Teacher_id_fkey" FOREIGN KEY ("id") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
  
  -- AddForeignKey
  ALTER TABLE "Program" ADD CONSTRAINT "Program_teacherID_fkey" FOREIGN KEY ("teacherID") REFERENCES "Teacher"("id") ON DELETE SET NULL ON UPDATE CASCADE;
  
  -- AddForeignKey
  ALTER TABLE "Course" ADD CONSTRAINT "Course_teacherID_fkey" FOREIGN KEY ("teacherID") REFERENCES "Teacher"("id") ON DELETE SET NULL ON UPDATE CASCADE;
  
  -- AddForeignKey
  ALTER TABLE "QuestionResult" ADD CONSTRAINT "QuestionResult_studentID_fkey" FOREIGN KEY ("studentID") REFERENCES "Student"("id") ON DELETE CASCADE ON UPDATE CASCADE;
  