-- CreateEnum
CREATE TYPE "ParentRegistrationStatus" AS ENUM ('PENDING', 'APPROVED', 'REJECTED');

-- CreateTable
CREATE TABLE "parent-registration" (
    "id" BIGSERIAL NOT NULL,
    "trackingCode" TEXT NOT NULL,
    "status" "ParentRegistrationStatus" NOT NULL DEFAULT 'PENDING',
    "parentId" BIGINT NOT NULL,
    "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,

    CONSTRAINT "parent-registration_pkey" PRIMARY KEY ("id")
);

-- CreateIndex
CREATE UNIQUE INDEX "parent-registration_trackingCode_key" ON "parent-registration"("trackingCode");

-- AddForeignKey
ALTER TABLE "parent-registration" ADD CONSTRAINT "parent-registration_parentId_fkey" FOREIGN KEY ("parentId") REFERENCES "parents"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
