hook_schema duplicate unique keys I am reading book 'Drupal 7 module development'.

I am try to follow book to create a hook_schema (I delete some line for better read): 

function artwork_schema() {
     $schema['artwork'] = array(
       'unique keys' =&gt; array(
         'aid_vid' =&gt; array('aid', 'vid'), // there is an 'aid'
         'aid'     =&gt; array('aid') // there is also an 'aid'
         ),
     );
     return $schema;
   }


what it is the meaning of the 2 aid?

Does mysql can create duplicate unique index?
A field that is not defined as unique key or primary key is allowed to have the same value in different records of that database table. So, if you don't want to have the same value of aid in two different records, you need to define it as unique key, if it is not already the primary key.

Notice that the line defining aid_vid as unique key would allow the following records.


aid  | vid  ! other_field
-------------------------
1      3      10
1      4      22
2      4      14


Only the line defining aid as unique key avoids two records have the same value for the aid field.