Reputation: 155
I want to have an attribute in a table that I want to be able to update. What is the best way to implement it?
Im using MySql
Upvotes: 0
Views: 52
Reputation: 12240
Second choice if better when want to update your attribute values. When your doing the update / insert of the new attribute, Id
of the attribute in the master table remains the same. You only need to do INSERT or UPDATE on your attributes table to add/change attributes.
If you go with the first choice and use ENUM
data type, you will need to do ALTER TABLE
every time you need to insert or update your attributes and you will need do an UPDATE
in the main table for every ENUM
value that changed.
Upvotes: 1