function text_update_1 in Content Construction Kit (CCK) 5
Add node ID column so we can delete old revisions at node delete time.
File
- ./
text.install, line 12
Code
function text_update_1() {
$ret = array();
switch ($GLOBALS['db_type']) {
case 'pgsql':
db_add_column($ret, 'node_field_shorttext_data', 'nid', 'integer', array(
'not null' => TRUE,
'default' => 0,
));
db_add_column($ret, 'node_field_longtext_data', 'nid', 'integer', array(
'not null' => TRUE,
'default' => 0,
));
break;
case 'mysql':
case 'mysqli':
$ret[] = update_sql("ALTER TABLE {node_field_shorttext_data} ADD COLUMN nid int(10) NOT NULL DEFAULT 0");
$ret[] = update_sql("ALTER TABLE {node_field_longtext_data} ADD COLUMN nid int(10) NOT NULL DEFAULT 0");
break;
}
return $ret;
}