Добрый день, создал файл install со следующим кодом, не как не могу сделать так чтобы автоинкременировалось поле id
<?php */
function procon_install() {
// Create tables.
drupal_install_schema('text');
}
/**
* Implementation of hook_schema().
*/
function procon_schema() {
$schema['text'] = array(
'fields' => array(
'id' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
),
'nid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'uid' => array(
'type' => 'varchar',
'length' => 10,
'not null' => TRUE,
'default' => 0,
),
'created' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0
),
'type' => array(
'type' => 'varchar',
'length' => 3,
'not null' => TRUE,
'default' => 0,
),
'text' => array(
'type' => 'varchar',
'length' => 244,
'not null' => TRUE,
'default' => 0,
),
'score' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0
),
),
'primary key' => array('nid'),
'indexes' => array(
'id' => array('id'),
),
);
return $schema;
}
/**
* Implementation of hook_uninstall().
*/
function procon_uninstall() {
// Remove tables.
drupal_uninstall_schema('text');
}?>