Add soft-delete support for tasks with deletedAt field and migration. Remove Apple Reminders iCloud integration entirely (API routes, lib, UI modal, and Python script) in favor of CalDAV approach. Add periodic pull-sync from Google Tasks every 2 minutes with deletion detection. Fix orphaned someday task rescue and cross-list task toggle/edit. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
11 lines
596 B
SQL
11 lines
596 B
SQL
-- AlterTable: Add soft delete column to Task
|
|
ALTER TABLE "Task" ADD COLUMN "deletedAt" TIMESTAMP(3);
|
|
|
|
-- CreateIndex: Index for efficient filtering of non-deleted tasks
|
|
CREATE INDEX "Task_userId_deletedAt_idx" ON "Task"("userId", "deletedAt");
|
|
|
|
-- AlterTable: Change onDelete behavior for somedayList relation
|
|
-- Drop old foreign key and add new one with SET NULL
|
|
ALTER TABLE "Task" DROP CONSTRAINT IF EXISTS "Task_somedayListId_fkey";
|
|
ALTER TABLE "Task" ADD CONSTRAINT "Task_somedayListId_fkey" FOREIGN KEY ("somedayListId") REFERENCES "SomedayList"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|