function faq_update_1 in Frequently Asked Questions 7.2
Same name and namespace in other branches
- 5.2 faq.install \faq_update_1()
- 5 faq.install \faq_update_1()
- 6 faq.install \faq_update_1()
- 7 faq.install \faq_update_1()
Create 'faq_weights' table in order to upgrade from older installations.
File
- ./
faq.install, line 155 - 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.');
}