Skip to content

Conversation

@stopachka
Copy link
Contributor

@stopachka stopachka commented Nov 18, 2025

We want a way to restore namespaces.

Problem

Imagine if a user deletes two namespaces with the same name:

  1. create posts { title }
  2. delete it
  3. create posts { title }
  4. delete it

If we looked at the attrs, we wouldn't be able to disambiguate them between the "first" table and the "second" table.

Solution

To disambiguate, I added an id_attr_id at the time of an attr's deletion to the metadata.

Todos

  • Add a sanity-check test for deleting the id attr
  • won't do: Throw an error if we can't find the id attr

@dwwoelfel @nezaj @drew-harris

Copy link
Contributor

@dwwoelfel dwwoelfel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

sm
@stopachka
Copy link
Contributor Author

Quick update: I added a sanity test deleting a full namespace. The other todo I had on the backend was to throw an error during deletes, if we don't find an id attr. I am thinking this may be a bit too harsh. I am a bit worried about throwing -- at least in tests we have lots of places where we don't use the id attr. My thinking is, the worst case scenario of the id attr not being found, is that the UI just won't show this deleted attr. It will be pretty easy to find it and restore it though.

@stopachka stopachka merged commit c83e98e into main Nov 19, 2025
32 checks passed
@stopachka stopachka deleted the delns1 branch November 19, 2025 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants