file .install don't create datatable

Events happening in the community are now at Drupal community events on www.drupal.org.
ocditimban's picture

<?php
function insertTable_schema(){
$schema['example']=array(
'fields' => array(
'nid' => array('type' =>'int','not null' => TRUE,'unsigned' => TRUE,'default' =>0),
),
'primary key' => array('nid'),
);
return $schema;
}
function insertTable_install(){
db_insert('example')
->fields(array(
'nid' =>1,
))
->execute();

}
function insertTable_uninstall() {

variable_del('example_default_status');
variable_del('example_threshold_limit');
variable_del('example_threshold_window');
}

this is my code but it's don't create datatable 'example' for me. Why???

Comments

This will work for you

veeraprasadd's picture

It works for me with the same code which you are using.
Try this..

function test_schema(){
$schema['example']=array(
'fields' => array(
'nid' => array('type' =>'int','not null' => TRUE,'unsigned' => TRUE,'default' =>0),
),
'primary key' => array('nid'),
);
return $schema;
}
function test_install(){
db_insert('example')->fields(array('nid' =>1,))->execute();
}
function test_uninstall() {
variable_del('example_default_status');
variable_del('example_threshold_limit');
variable_del('example_threshold_window');
}

Regards,
Veera Prasad Dagudu
www.drup-all.com

Drupal Books in Libraries

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: