Trying to create a table with an uid field that auto-increments and is the primary key, but keep getting an error I'm working on an .install file for my module in Drupal 7.  I want to create two tables, one called tls_connect_floormap_images and one called tls_connect_floormap_coords.  I'm not having any trouble with the _images table.  But when I try to make the uid field of the _coords table a unique key that auto-increments, I get an error that says:


  Fatal error: Unsupported operand types in C:\Program Files
  (x86)\Zend\Apache2\htdocs\TLSConnect3App\includes\database\mysql\schema.inc
  on line 85


I get this error on install, When I Save Configuration I get the WSOD with the error message.  When I put in the url for /admin/modules there is an error that says Notice: Undefined variable: schema in floormap_install() (line 37 of C:\Program Files (x86)\Zend\Apache2\htdocs\TLSConnect3App\sites\all\modules\custom\TLSConnectPackage\floormap\floormap.install).  I see that the module is installed though, and when I check for my tables in phpMyAdmin they are there, uid auto_increments but is not a unique or primary key.

Here is my code:

function floormap_schema(){
    $schema['floormap_images'] = array (
            'description'   =&gt; 'Floor map images.',
            'fields'        =&gt; array (
                'image'     =&gt; array('type'     =&gt; 'blob',      'not null'  =&gt; TRUE,),
                'name'      =&gt; array( 'type'        =&gt; 'varchar',       'length'        =&gt; 30,      'not null'  =&gt; TRUE,),
                'active'    =&gt; array('type'     =&gt; 'int',           'unsigned'  =&gt; TRUE,    'not null'  =&gt; TRUE,),
            ),
            'unique keys'   =&gt; array('name' =&gt; array('name'),
            ),
        );  
    $schema['floormap_coords'] = array (
        'description'   =&gt; 'Floor map images.',
        'fields'        =&gt; array (
            'uid'       =&gt; array( 'type'    =&gt; 'serial',    'unsigned'  =&gt; TRUE,    'not null'  =&gt; TRUE,),
            'floormap'  =&gt; array( 'type'    =&gt; 'text',  'not null'  =&gt; TRUE,),
            'item_type' =&gt; array( 'type'    =&gt; 'text',  'not null'  =&gt; TRUE,),
            'pos_a_x'   =&gt; array( 'type'    =&gt; 'int',       'unsigned'  =&gt; TRUE,    'not null'  =&gt; TRUE,),
            'pos_a_y'   =&gt; array( 'type'    =&gt; 'int',       'unsiged'   =&gt; TRUE,    'not null'  =&gt; TRUE,),
            'pos_b_x'   =&gt; array( 'type'    =&gt; 'int',       'unsigned'  =&gt; TRUE,    'not null'  =&gt; TRUE,),
            'pos_b_y'   =&gt; array( 'type'    =&gt; 'int',       'unsiged'   =&gt; TRUE,    'not null'  =&gt; TRUE,),
            'pos_c_x'   =&gt; array( 'type'    =&gt; 'int',       'unsigned'  =&gt; TRUE,    'not null'  =&gt; TRUE,),
            'pos_c_y'   =&gt; array( 'type'    =&gt; 'int',       'unsiged'   =&gt; TRUE,'   not null'   =&gt; TRUE,),
            'pos_d_x'   =&gt; array('type' =&gt; 'int',       'unsigned'  =&gt; TRUE,    'not null'  =&gt; TRUE,),
            'pos_d_y'   =&gt; array('type' =&gt; 'int',       'unsiged'   =&gt; TRUE,    'not null'  =&gt; TRUE,),
        ),
        'unique keys'   =&gt; array('uid' =&gt; array('uid'),),
    );  
    return $schema;
}
function floormap_install() {

    //Create table to store floor map images if it doesn't already exist
    if(!db_table_exists('tls_connect_floormap_images')){
        db_create_table('tls_connect_floormap_images',$schema['floormap_images']);
    }
    //Create table to store floor map coordinates if it doesn't already exist
    if(!db_table_exists('tls_connect_floormap_coords')){
        db_create_table('tls_connect_floormap_coords',$schema['floormap_coords']);
    }
}


I only get the error when I have 

'unique keys' =&gt; array('uid' =&gt; array('uid'),),


in the $schema['floormap_coords'] array.  It works in the ['floormap_images'] array though, not sure why its not working for coords.  The only difference is that the 'uid' field is serial datatype and name is varchar.
First of all please provide which version of drupal you are using ? 

If you are using d7 than you don't need to check in hook_install is table exists ?

Just provide hook_schema in your module file and it will create your tables.
For floormap_coords make uid as primary ( primary key itself unique)
'primary key' => array('uid'),