title: Database design: How to handle cancelled orders but save the order history
body: <p>How can the following scenario be handled with a database?</p>
  <p>There are the following database relations:</p>
  <h2>User</h2>
  <p>has many Orders
  has many Tickets</p>
  <h2>Order</h2>
  <p>has many Payments
  has many OrderItems</p>
  <h2>Ticket</h2>
  <p>belongs to OrderItem
  belongs to User
  belongs to TicketCategory</p>
  <h2>TicketCategory</h2>
  <p>has many tickets</p>
  <p>A ticket is created in the database whenever a user places an order. How can the case be handled here when a payment fails or a user leaves the page in the payment process? I would actually like to create only tickets that belong to a successful order, but otherwise it is not possible to determine which tickets were attempted to be purchased in the case of an aborted payment (order history).</p>
  <p>Is there a missing intermediate table like reservations or something?</p>