Why am I getting this error for the schema I define in my module?
I've managed to fix it. I've altered 2 things from my original schema, the first issue was that Drupal 7 no longer supports 'type' =&gt; 'datetime', instead use 'mysql_type' =&gt; 'datetime'. The second was 'unique keys' =&gt; array('id'), I removed this and everything works correctly.
Solution...
$schema['table_name'] = array(
        'fields' =&gt; array(
            'id' =&gt; array(
                'type' =&gt; 'serial',
                'unsigned' =&gt; true,
                'not null' =&gt; true,
                'length' =&gt; 11
            ),
            'nid' =&gt; array(
                'type' =&gt; 'int',
                'unsigned' =&gt; true,
                'not null' =&gt; true,
                'length' =&gt; 11
            ),
            'oid' =&gt; array(
                'type' =&gt; 'int',
                'unsigned' =&gt; true,
                'not null' =&gt; true,
                'length' =&gt; 11
            ),
            'start_time' =&gt; array(
                'type' =&gt; 'int',
                'mysql_type' =&gt; 'datetime',
                'size' =&gt; 'normal',
                'not null' =&gt; false
            ),
            'end_time' =&gt; array(
                'type' =&gt; 'int',
                'mysql_type' =&gt; 'datetime',
                'size' =&gt; 'normal',
                'not null' =&gt; false
            ),
            'duration' =&gt; array(
                'type' =&gt; 'int',
                'unsigned' =&gt; true,
                'not null' =&gt; true,
                'length' =&gt; 11
            )
        ),
        'primary key' =&gt; array('id'),
        'mysql_engine' =&gt; 'InnoDB'
    );