mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-10-11 07:13:17 +01:00
Detect time entries with a task but no project in consistency check
The comparison used != which evaluates to NULL when the time entry has no project, so entries that kept their task after the project was removed were not reported.
This commit is contained in:
@@ -39,7 +39,7 @@ class SelfHostDatabaseConsistency extends Command
|
||||
$problems = DB::table('time_entries')
|
||||
->select(['time_entries.id as id'])
|
||||
->join('tasks', 'time_entries.task_id', '=', 'tasks.id')
|
||||
->where('tasks.project_id', '!=', DB::raw('time_entries.project_id'))
|
||||
->whereRaw('tasks.project_id is distinct from time_entries.project_id')
|
||||
->get();
|
||||
$this->logProblems($problems, 'Time entries have a task that does not belong to the project of the time entry', $hadAProblem);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user