You are here

function faq_update_1 in Frequently Asked Questions 7

Same name and namespace in other branches
  1. 5.2 faq.install \faq_update_1()
  2. 5 faq.install \faq_update_1()
  3. 6 faq.install \faq_update_1()
  4. 7.2 faq.install \faq_update_1()

Create 'faq_weights' table in order to upgrade from older installations.

File

./faq.install, line 188
FAQ module install file.

Code

function faq_update_1() {
  $schema['faq_weights'] = array(
    'description' => 'A table containing the weight of each faq node by category.',
    'fields' => array(
      'tid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'nid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'weight' => array(
        'type' => 'int',
        'size' => 'tiny',
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'nid',
      'tid',
    ),
  );
  $ret = array();
  db_create_table('faq_weights', $schema['faq_weights']);
  return t('FAQ weighting table created.');
}