enter image description here

It would be necessary to make var_key unique, what is the best way to proceed, create another table with keys and store the ID in the var_key field?

  • A unique key can be made on 2 fields. I would do it on lang and var_key - E_p
  • one
    ALTER TABLE table_name ADD UNIQUE unique_index ( var_key , lang ); - E_p
  • Thanks for the advice - quaresma89

1 answer 1

MySQL allows you to create keys for multiple fields which is convenient when the combination should be unique.

 ALTER TABLE `table_name` ADD UNIQUE `unique_index`(`field_1`, `field_2` ...);