Creating the tickets table in the database
To be able to manage the tickets, we first need to create a table for its data. However, which columns will we need to create? Let’s have a look at our current UI, the Ticket Details page, that is shown when you click on one of the mock tickets on our ticket list:
Figure 8.1: Our current ticket creation form
Given the existing UI, we can derive the minimal set of fields we need in the table (and in parentheses, I have included intuitive column names):
- A unique ticket id (
id
) - The state of the ticket, for example, Open or Done (
status
) - The author of the ticket (
created_by
) - The creation date (
created_at
) - A ticket title (
title
) - A ticket description (
description
) - The tenant ID to which the ticket belongs (
tenant
)
Note
Forget about the comments section shown in Figure 8.1 for now. This involves additional database work that we’ll handle separately in Chapter 10...