-- Payment scheduling: pledges can have a future due date and installment plans
ALTER TABLE "Pledge" ADD COLUMN "dueDate" TIMESTAMP(3);
ALTER TABLE "Pledge" ADD COLUMN "planId" TEXT;
ALTER TABLE "Pledge" ADD COLUMN "installmentNumber" INTEGER;
ALTER TABLE "Pledge" ADD COLUMN "installmentTotal" INTEGER;
ALTER TABLE "Pledge" ADD COLUMN "reminderSentForDueDate" BOOLEAN NOT NULL DEFAULT false;

-- Index for finding pledges due today/upcoming
CREATE INDEX "Pledge_dueDate_status_idx" ON "Pledge"("dueDate", "status");
CREATE INDEX "Pledge_planId_idx" ON "Pledge"("planId");
