Organize/prisma/migrations/20260814000000_add_todo_com.../migration.sql

9 lines
412 B
SQL

-- AlterTable
ALTER TABLE "Todo" ADD COLUMN "completedAt" TIMESTAMP(3);
-- Backfill: approximate the completion time for to-dos that were already
-- marked done before this column existed. `updatedAt` is the closest
-- signal available -- for an already-completed to-do, the last write to
-- the row is often the completion toggle itself.
UPDATE "Todo" SET "completedAt" = "updatedAt" WHERE "completed" = true;