-- CreateTable
CREATE TABLE "ProjectCode" (
    "id" TEXT NOT NULL,
    "code" TEXT NOT NULL,
    "isActive" BOOLEAN NOT NULL DEFAULT true,
    "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updatedAt" TIMESTAMP(3) NOT NULL,

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

-- CreateIndex
CREATE UNIQUE INDEX "ProjectCode_code_key" ON "ProjectCode"("code");

-- Seed the previously-hardcoded project codes so the dropdown stays populated
-- after this feature replaces the static list (issue #124).
INSERT INTO "ProjectCode" ("id", "code", "updatedAt") VALUES
  ('pcseed_petronet', 'Petronet LNG Cochin', CURRENT_TIMESTAMP),
  ('pcseed_comacoe_trombay', 'COMACOE Trombay', CURRENT_TIMESTAMP),
  ('pcseed_haldia_reach', 'Haldia Reach', CURRENT_TIMESTAMP),
  ('pcseed_haldia_mmt', 'Haldia MMT', CURRENT_TIMESTAMP),
  ('pcseed_comacoe_mandvi', 'COMACOE Mandvi', CURRENT_TIMESTAMP);
