-- AlterTable
ALTER TABLE "Task" ADD COLUMN     "isRecurring" BOOLEAN NOT NULL DEFAULT false,
ADD COLUMN     "isRolling" BOOLEAN NOT NULL DEFAULT false,
ADD COLUMN     "recurrenceEndDate" TIMESTAMP(3),
ADD COLUMN     "recurrenceInterval" INTEGER,
ADD COLUMN     "recurrenceTime" TEXT,
ADD COLUMN     "recurrenceUnit" TEXT;

-- AlterTable
ALTER TABLE "User" ADD COLUMN     "autoRolling" BOOLEAN NOT NULL DEFAULT false,
ADD COLUMN     "calendarEditMode" BOOLEAN NOT NULL DEFAULT false,
ADD COLUMN     "dateFormat" TEXT NOT NULL DEFAULT 'yyyy-MM-dd',
ADD COLUMN     "endHour" INTEGER NOT NULL DEFAULT 22,
ADD COLUMN     "focusTimerDuration" INTEGER NOT NULL DEFAULT 25,
ADD COLUMN     "language" TEXT NOT NULL DEFAULT 'de',
ADD COLUMN     "protectEventTimes" BOOLEAN NOT NULL DEFAULT false,
ADD COLUMN     "showNextTask" BOOLEAN NOT NULL DEFAULT false,
ADD COLUMN     "startHour" INTEGER NOT NULL DEFAULT 8,
ADD COLUMN     "timeFormat" TEXT NOT NULL DEFAULT '24h';

-- CreateTable
CREATE TABLE "SomedayList" (
    "id" TEXT NOT NULL,
    "userId" TEXT NOT NULL,
    "title" TEXT NOT NULL,
    "order" INTEGER NOT NULL DEFAULT 0,
    "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updatedAt" TIMESTAMP(3) NOT NULL,

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

-- CreateIndex
CREATE INDEX "SomedayList_userId_idx" ON "SomedayList"("userId");

-- AddForeignKey
ALTER TABLE "Task" ADD CONSTRAINT "Task_somedayListId_fkey" FOREIGN KEY ("somedayListId") REFERENCES "SomedayList"("id") ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "SomedayList" ADD CONSTRAINT "SomedayList_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
