|
From my point of view, your fix in reality does not seems to fix it. Yes, you have incorporated standalone Category entity which is good thing, but lets say I have 10 categories named "cat1", "cat2", "cat3" ... "cat10".
With your fix, there are 3 tables
1) Installation table 2) Installation_Category table which has two attributes, "Installation_id" and "categories_id". 3) Category table, which has "id" and "name" attributes.
What it does right now is that "categories_id" in Installation_Category table maps to "id" in "Category" table.
When I have 1000 categories and I assign e.g. 50 categories from these 1000 to some installation, even I pick category with the same name, it is considered as totally new category.
So in the end, I have this in Category table:
id name
1 cat1
2 cat1
3 cat2
4 cat1
I want it like this
So in that Installation_Category table I want it to have like this
Installation_id categories_id
uuid1 1
uuid1 2
uuid1 3
uuid2 2
uuid3 1
instead of this
uuid1 1
uuid1 2
uuid1 3
uuid1 4
uuid2 5
uuid3 6
uuid4 7
uuid5 8
In other words, category should be unique according to its name. It does not make sense at all to have multiple categories with same names - it solves nothing regarding perfomance and database storing effectivity since it generates new category every time.
|