I created a table on my 6100 database update with 2 fields and now I need to update this table i.e. add 6 more fields. I tried the following code but it didn't work. Database Query Failed.

function test_module_update_6200(){
$schema['test_module'] = array(
'fields' => array(
'id' => array('type' => 'int', 'not null' => TRUE, 'unsigned' => TRUE, 'type' => 'serial'),
'xyz' => array('type' => 'varchar', 'length' => 64, 'not null' => TRUE),
'abc' => array('type' => 'varchar', 'length' => 64, 'not null' => TRUE),.
'mhb' => array('type' => 'int', 'not null' => TRUE, 'unsigned' => TRUE),
'fiq' => array('type' => 'varchar', 'length' => 512, 'not null' => TRUE),
'oka' => array('type' => 'int', 'not null' => TRUE, 'unsigned' => TRUE, 'default' => 0),
),
'primary key' => array('id')
);

$ret = array();
db_create_table($ret, 'test_module', $schema['test_module']);
return $ret;
}

In my 6100 update I had two fields which are not any of these above fields. If I write drop statement, for a new installation, it will create problem. It would be of great help if suggest me a good alternate for this problem.

Thank you for you time.
Moiz

Comments

zzolo’s picture

Priority: Critical » Normal
Status: Active » Closed (fixed)

This problem seems to be a general Drupal support question. This issue queue is for the APISite profile. If you need general Drupal help, please check out the forums, the handbooks, and IRC.