title: Rails App incremental ticket number for different accounts
body: <p>I have a multi-tenant Rails app that creates support tickets. The tickets are supposed to have incremetal ticket numbers. I can't use the ID column, because since the app will be used by different accounts, they will find odd ticket numbers.</p>
  
  <p>For example, if Account 1 creates two tickets, they get Ticket #1 and Ticket #2. Account 2 creates one ticket, he gets Ticket #3. (That would be odd because he's supposed to get Ticket #1, because it's the first ticket he creates under his account).</p>
  
  <p>So, I'm supposed to add a ticket_number column to the tickets table. Now, how would you go about incrementing the numbers automatically and being separated from other accounts?</p>