This topic must be fairly common but I can't seem to find what I'm looking for.
Table Products has columns ProductID (PK), ProductName, ...
ProductID is FK in other tables.
This works well as long as ProductID=1234 and ProductName="Twinkies". However, marketing will eventually change "Twinkies" to "Delicious Twinkies". Same physical product BUT they want the same ProductID with a different name/spin.
What's the best way to handle this?
- Set ProductID + ProductName as PK and tell marketing that if they change the ProductName, they must accept a new ProductID?
- Keep ProductID unique, allow ProductName to change, and stuff current ProductID & ProductName into transaction history table?
- ?
It seems that ProductID + ProductName as PK is correct but it doesn't feel right to me.
This is for a commercial product with at least 1K databases in the wild. The current implementation is ProductID (PK). If a schema change is required, the question of "how to get there from here" is a factor.
Thanks for your help.
Table Products has columns ProductID (PK), ProductName, ...
ProductID is FK in other tables.
This works well as long as ProductID=1234 and ProductName="Twinkies". However, marketing will eventually change "Twinkies" to "Delicious Twinkies". Same physical product BUT they want the same ProductID with a different name/spin.
What's the best way to handle this?
- Set ProductID + ProductName as PK and tell marketing that if they change the ProductName, they must accept a new ProductID?
- Keep ProductID unique, allow ProductName to change, and stuff current ProductID & ProductName into transaction history table?
- ?
It seems that ProductID + ProductName as PK is correct but it doesn't feel right to me.
This is for a commercial product with at least 1K databases in the wild. The current implementation is ProductID (PK). If a schema change is required, the question of "how to get there from here" is a factor.
Thanks for your help.