The desire is a model_record sequence number. In other words, while the record table might contain customers for one tenant and invoices for another tenant, the first tenant will want their customer records numbered from 1, and the second tenant will want their invoices numbered from 1. So a sequence on the record table will not work.
So this task is about finding a way to make that happen.
One sequence for each aggregate root model is possible I suppose. But in docsndata maintaining a sequence for the record table allowed me to , for each model_id, find the latest record and get its model_record_id, and then assign that + 1 to the record being created.
If #50 is done, this will be model_record_environment_count
The desire is a model_record sequence number. In other words, while the record table might contain customers for one tenant and invoices for another tenant, the first tenant will want their customer records numbered from 1, and the second tenant will want their invoices numbered from 1. So a sequence on the record table will not work.
So this task is about finding a way to make that happen.
One sequence for each aggregate root model is possible I suppose. But in docsndata maintaining a sequence for the record table allowed me to , for each model_id, find the latest record and get its model_record_id, and then assign that + 1 to the record being created.
If #50 is done, this will be model_record_environment_count