Implement soft-delete for client targets and balance corrections
Deleting a target or correction sets deletedAt instead of hard-deleting. Creating a target for a user+client that has a soft-deleted record reactivates it (clears deletedAt, applies new weeklyHours/startDate) rather than failing the unique constraint. All reads filter deletedAt = null on the target, its corrections, and the parent client.
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
-- AlterTable: add deleted_at column to client_targets
|
||||
ALTER TABLE "client_targets" ADD COLUMN "deleted_at" TIMESTAMP(3);
|
||||
|
||||
-- AlterTable: add deleted_at column to balance_corrections
|
||||
ALTER TABLE "balance_corrections" ADD COLUMN "deleted_at" TIMESTAMP(3);
|
||||
Reference in New Issue
Block a user