I am currently encoding a product that will have only one database, but will contain many clients using the global identifier customer_id.
All this is very good.
However, let's say we have a Ticket table. An idea has a primary key. When a user adds a ticket, the ticket will match the customer with a foreign key, etc.
However, for each client, I want their ticket IDs to begin with 1 when they sign.
i.e. client 1 adds 4 tickets, the ticket_id counter will be 4. Client 2 signs up, they add a ticket, and then ticket_id will be 5 and so on and so forth. Which is not perfect.
My question to you is: how do I get around this if I do not want to use multiple databases? The idea of updating requires hundreds of databases with new columns, indexes, etc. Whenever I made changes, I would be very annoyed.
Hope this makes sense and I look forward to your input.
EDIT: tagged symfony, since I will use Doctrine ORM in symfony to manage the database .... probably doesn't matter, but added just in case.
EDIT: I can also be stupid and miss something obvious here, so my apologies.
source
share