added status restriction
This commit is contained in:
-21
@@ -88,7 +88,6 @@ return new class extends Migration
|
||||
->update(['ticket_status_id' => $ticketStatusId]);
|
||||
});
|
||||
|
||||
$this->createFullTransitionMatrix((int) $project->id);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -110,24 +109,4 @@ return new class extends Migration
|
||||
'updated_at' => $now,
|
||||
]);
|
||||
}
|
||||
|
||||
private function createFullTransitionMatrix(int $projectId): void
|
||||
{
|
||||
$now = now();
|
||||
$statusIds = DB::table('ticket_statuses')
|
||||
->where('project_id', $projectId)
|
||||
->pluck('id')
|
||||
->map(fn (int|string $statusId): int => (int) $statusId);
|
||||
|
||||
$statusIds->each(function (int $fromStatusId) use ($now, $statusIds): void {
|
||||
$statusIds->each(function (int $toStatusId) use ($fromStatusId, $now): void {
|
||||
DB::table('ticket_status_transitions')->insertOrIgnore([
|
||||
'created_at' => $now,
|
||||
'from_ticket_status_id' => $fromStatusId,
|
||||
'to_ticket_status_id' => $toStatusId,
|
||||
'updated_at' => $now,
|
||||
]);
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user