Which type to use for checkbox fields in hook_field_schema? Task:

Create a custom field which contains a single checkbox by implementing hook_field_schema etc.

Question:

Which data type is (or should) be used to define the corresponding database column to save checkbox values?

Sample code:

function field_test_field_schema ($field)
{
    $columns = array();
    switch ($field['type']) {
        case 'test':
            $columns = array(
                    'value' =&gt; array(
                            'type' =&gt; '???',
                            'not null' =&gt; TRUE
                    ),
            );
            break;
    }
    return array('columns'=&gt; $columns);
}


Update:
node_schema uses int for boolean columns. e.g. :

'status' =&gt; array(
  'description' =&gt; 'Boolean indicating whether the node is published (visible to non-administrators).',
  'type' =&gt; 'int',
  'not null' =&gt; TRUE,
  'default' =&gt; 1,
)
A tiny int would be most appropriate in my opinion:

$columns = array(
  'value' =&gt; array(
    'type' =&gt; 'int',
    'not null' =&gt; TRUE,
    'size' =&gt; 'tiny',
    'default' =&gt; 0,
  ),
);


A 'standard' int would be overkill for a field that will only ever hold a 0 or 1 value.

See the Data types docs for an overview of the different types available to you.