Sequential IDs for Multi-tenant App?


#1

Any suggestion on how to add items to the database and give them sequential IDs per client? Example:

aleint_A’s items IDs: 1, 2, 3, …
cleint_B’s items IDs: 1, 2, 3, …
cleint_C’s items IDs: 1, 2, 3, …
etc.

Given that data might be created in a local realm first then synced later on.


#2

In order to achieve the above requirement, I’m thinking of making a new database per client instead of using the same db for all clients; but I’m not sure how to programmatically create databases in this case!