Allowing the setting and editing of an assignee to a ticket
For any ticket, we want to allow the setting of an assignee. The assignee column is very much identical to the created_by column, with the only difference being that it shall also cache the name if the ticket was ever edited and updated to another assignee. Let’s first adapt the database table accordingly.
Adding assignee columns in the tickets table
To add more columns to the tickets table, click on Edit Table:
Figure 9.10: Edit tickets table
Then, add two new columns:
assignee: Like thecreated_bycolumn, this must have a relation to theservice_userstableassignee_name: This is similar toauthor_name, being of thetexttype
We don’t enforce assignees so both can be nullable.
Figure 9.11: The assignee columns with relation added
Once done, save the changes, and let’s make sure the name is cached.