Community Documentation

filter_update_7000

7 filter.install filter_update_7000()

Upgrade the {filter_formats} table and rename it to {filter_format}.

File

modules/filter/filter.install, line 172
Install, update and uninstall functions for the filter module.

Code

<?php
function filter_update_7000() {
  db_rename_table('filter_formats', 'filter_format');

  // Add the new {filter_format}.status and {filter_format}.weight column.
  db_add_field('filter_format', 'status', array(
    'type' => 'int', 
    'unsigned' => TRUE, 
    'not null' => TRUE, 
    'default' => 1, 
    'size' => 'tiny', 
    'description' => 'The status of the text format. (1 = enabled, 0 = disabled)',
  ));
  db_add_field('filter_format', 'weight', array(
    'type' => 'int', 
    'not null' => TRUE, 
    'default' => 0, 
    'description' => 'Weight of text format to use when listing.',
  ), array(
    'indexes' => array(
      'status_weight' => array('status', 'weight'),
    ),
  ));
}
?>
Login or register to post comments