function guestbook_update_7000 in Guestbook 7.2
Add {guestbook}.message_format and {guestbook}.comment_format column.
File
- ./
guestbook.install, line 69
Code
function guestbook_update_7000() {
$format_id = (string) variable_get('guestbook_input_format', 1);
db_add_field('guestbook', 'message_format', array(
'type' => 'varchar',
'length' => 255,
'not null' => FALSE,
'initial' => $format_id,
'description' => 'The {filter_format}.format of the message.',
));
db_add_field('guestbook', 'comment_format', array(
'type' => 'varchar',
'length' => 255,
'not null' => FALSE,
'description' => 'The {filter_format}.format of the comment.',
));
db_update('guestbook')
->fields(array(
'comment_format' => $format_id,
))
->condition('comment', '', '<>')
->execute();
variable_del('guestbook_input_format');
variable_del('guestbook_filter_tips');
}