-- CreateTable
CREATE TABLE "admin" (
    "id" SERIAL NOT NULL,
    "name" TEXT NOT NULL,
    "email" TEXT NOT NULL,
    "adminId" TEXT NOT NULL,
    "password" TEXT NOT NULL,

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

-- CreateTable
CREATE TABLE "jobSkillDetail" (
    "id" SERIAL NOT NULL,
    "name" TEXT NOT NULL,
    "jobSkillId" INTEGER NOT NULL,

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

-- CreateTable
CREATE TABLE "jobSkill" (
    "id" SERIAL NOT NULL,
    "jobTitle" TEXT NOT NULL,
    "adminId" TEXT NOT NULL,

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

-- CreateTable
CREATE TABLE "jobSummaryDescription" (
    "id" SERIAL NOT NULL,
    "description" TEXT NOT NULL,
    "jobSummaryId" INTEGER NOT NULL,

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

-- CreateTable
CREATE TABLE "jobSummary" (
    "id" SERIAL NOT NULL,
    "jobTitle" TEXT NOT NULL,
    "adminId" TEXT NOT NULL,

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

-- CreateTable
CREATE TABLE "jobTitles" (
    "id" SERIAL NOT NULL,
    "title" TEXT NOT NULL,

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

-- CreateIndex
CREATE UNIQUE INDEX "admin_id_key" ON "admin"("id");

-- CreateIndex
CREATE UNIQUE INDEX "admin_email_key" ON "admin"("email");

-- CreateIndex
CREATE UNIQUE INDEX "admin_adminId_key" ON "admin"("adminId");

-- AddForeignKey
ALTER TABLE "jobSkillDetail" ADD CONSTRAINT "jobSkillDetail_jobSkillId_fkey" FOREIGN KEY ("jobSkillId") REFERENCES "jobSkill"("id") ON DELETE RESTRICT ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "jobSummaryDescription" ADD CONSTRAINT "jobSummaryDescription_jobSummaryId_fkey" FOREIGN KEY ("jobSummaryId") REFERENCES "jobSummary"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
