Pelvis Posted February 1, 2020 Share Posted February 1, 2020 Hallo Community! When we add a new language, in the database some tables (eg products_description) get duplicated ids. For example we have for the same products_id values for both English and german ..the thing is that since in products_id is a Primary key,this seems to violate the uniqueness of the key and generally, Sql throws an error if we try to add a new row with an existing id. So the question is how can we do the same thing (duplicated rows for two ids), in tables apart from those that change when we add a language. Link to comment Share on other sites More sharing options...
♥ecartz Posted February 1, 2020 Share Posted February 1, 2020 The products_description table has a multiple column key on products_id and language_id. PRIMARY KEY (products_id,language_id), So one row per combination. I.e. if English is 1 and German is 2, then you can have products_id 1/language_id 1 and products_id 1/language_id 2 but not a second 1/1. You could change other tables to have multiple column keys too or even remove the key entirely. But weird things can happen if the system is relying on the values being unique. Always back up before making changes. Link to comment Share on other sites More sharing options...
Pelvis Posted February 3, 2020 Author Share Posted February 3, 2020 Thank you so much! now I have understand how it works :-) Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.