You are here

function faq_update_1 in Frequently Asked Questions 6

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

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

Should have been created with faq_update_600x() naming convention, but too late now.

Return value

An array containing the structure of the SQL schema.

File

./faq.install, line 114
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($ret, 'faq_weights', $schema['faq_weights']);
  return $ret;
}