-- AlterTable
ALTER TABLE "plenary_rgc_decisions" ADD COLUMN     "indicator_id" INTEGER;

-- CreateTable
CREATE TABLE "indicators" (
    "id" SERIAL NOT NULL,
    "name" VARCHAR(100) NOT NULL,
    "description" TEXT,
    "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updated_at" TIMESTAMP(3) NOT NULL,
    "deleted_at" TIMESTAMP(3),

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

-- CreateIndex
CREATE INDEX "indicators_name_idx" ON "indicators"("name");

-- CreateIndex
CREATE INDEX "indicators_deleted_at_idx" ON "indicators"("deleted_at");

-- CreateIndex
CREATE INDEX "plenary_rgc_decisions_indicator_id_idx" ON "plenary_rgc_decisions"("indicator_id");

-- CreateIndex
CREATE INDEX "plenary_rgc_decisions_meeting_date_idx" ON "plenary_rgc_decisions"("meeting_date");

-- AddForeignKey
ALTER TABLE "plenary_rgc_decisions" ADD CONSTRAINT "plenary_rgc_decisions_indicator_id_fkey" FOREIGN KEY ("indicator_id") REFERENCES "indicators"("id") ON DELETE SET NULL ON UPDATE CASCADE;
