-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(2589): soft delete unused asset #2699
Conversation
✅ Deploy Preview for brilliant-pasca-3e80ec canceled.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
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 ? |
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just minor test comment
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