Skip to content
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

Revert entities to using recognizable IDs instead of UUIDs #60

Closed
dividor opened this issue Dec 5, 2022 · 1 comment
Closed

Revert entities to using recognizable IDs instead of UUIDs #60

dividor opened this issue Dec 5, 2022 · 1 comment

Comments

@dividor
Copy link
Contributor

dividor commented Dec 5, 2022

Describe your maintenance task
UUIDs make great sense when we need a unique ID for thousands of records, but in some cases they can be cumbersome in a referential DB context. Entities are one example. Because they ARE UUIDs and are regenerated if looked at, maintaining them add SIGNIFICANT overhead to any code changes we do. Self tests all change with the tiniest adjustment, and there are confusing loops and turns in the code to get entity_id from name and vice versa. It's a massive pain.

The proposed task is to:

  1. Keep the entity_id column on configured_entities, but a unique text field like project_id is on project
  2. Search for any code referencing entity_name and replace with entity_id
  3. Remove any reference of the methods to look up name from id and vice versa
  4. Update all the tests, db upgrade script etc

It a big job, but life will be so much simpler afterwards! :)

@dividor dividor mentioned this issue Mar 27, 2023
@JanPeterDatakind
Copy link
Contributor

Implemented for release 1.0.5 by replacing the values of entity_id with those of entity_name and getting rid of entity_name.

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

No branches or pull requests

2 participants