cozemble / monorepo

A data and process canvas
https://cozemble.com
Apache License 2.0
13 stars 1 forks source link

Support model_record_count - model specific sequence numbers #51

Closed mike-hogan closed 1 year ago

mike-hogan commented 1 year ago

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

mike-hogan commented 1 year ago

Done using a sequence for every model