Closed lengyel-arpad85 closed 4 months ago
Name | Link |
---|---|
Latest commit | bdc5e1b1ac74df203af21ef24c15586970dd5077 |
Latest deploy log | https://app.netlify.com/sites/brilliant-pasca-3e80ec/deploys/66525ff288f2810008a91358 |
My main question is, what should we do when we delete an asset, then try to re-create another one with the same code and scale (via
createAsset
mutation)?Right now, we will get a "duplicate asset" error, but that might be a bit confusing given the asset isn't visible in the UI. Maybe we can just set deletedAt to be null again, and return the asset?
yes, that might work, but if the scale is different from what we had before, do we just update the scale to the new one ?
@arpad-lengyel
yes, that might work, but if the scale is different from what we had before, do we just update the scale to the new one ?
An asset is unique on scale and code together, so that would signify a new/different asset
@arpad-lengyel
yes, that might work, but if the scale is different from what we had before, do we just update the scale to the new one ?
An asset is unique on scale and code together, so that would signify a new/different asset
@mkurapov It's an unused asset, so in theory it should not matter what the previous scale was, it was never used, so it won't have an effect on anything, no ?
It's an unused asset, so in theory it should not matter what the previous scale was, it was never used, so it won't have an effect on anything, no ?
Right, however I would say to be safe, we should treat e.g. USD/9 vs USD/2 as completely different assets (even if they have the same asset code). This is reflected in the DB as well:
It's an unused asset, so in theory it should not matter what the previous scale was, it was never used, so it won't have an effect on anything, no ?
Right, however I would say to be safe, we should treat e.g. USD/9 vs USD/2 as completely different assets (even if they have the same asset code). This is reflected in the DB as well:
yes, you are right, I've corrected the condition in my code
Soft delete asset including the Admin frontend part, by adding a deletedAt date and filtering get & getAll calls for deletedAt being NULL This approach was adopted instead of hard delete since TigerBeetle has no support for deleting rows
Checklist
fixes #number