Implement soft-delete for clients, projects, and time entries

Replace hard deletes with deletedAt timestamp flags on all three entities.
Deleting a client or project only sets its own deletedAt; child records are
excluded implicitly by filtering on parent deletedAt in every read query.
Raw SQL statistics queries also filter out soft-deleted parents.
FK ON DELETE CASCADE removed from Project→Client and TimeEntry→Project.
This commit is contained in:
simon.franken
2026-02-23 15:21:13 +01:00
parent 685a311001
commit 1a7d13d5b9
6 changed files with 97 additions and 40 deletions

View File

@@ -11,6 +11,7 @@ export interface Client {
description: string | null;
createdAt: string;
updatedAt: string;
deletedAt: string | null;
}
export interface Project {
@@ -22,6 +23,7 @@ export interface Project {
client: Pick<Client, 'id' | 'name'>;
createdAt: string;
updatedAt: string;
deletedAt: string | null;
}
export interface TimeEntry {
@@ -36,6 +38,7 @@ export interface TimeEntry {
};
createdAt: string;
updatedAt: string;
deletedAt: string | null;
}
export interface OngoingTimer {