shoutbox_group.install in Shoutbox 6.2
File
shoutbox_group/shoutbox_group.install
View source
<?php
function shoutbox_group_schema() {
$schema['shoutbox_groups'] = array(
'description' => 'Link shouts to their respected group.',
'fields' => array(
'shout_id' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'description' => 'The shout id',
),
'nid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'description' => 'The organic group node id',
),
),
'primary key' => array(
'shout_id',
),
);
return $schema;
}
function shoutbox_group_install() {
drupal_install_schema('shoutbox_group');
shoutbox_group_weight_module();
}
function shoutbox_group_uninstall() {
drupal_uninstall_schema('shoutbox_group');
}
function shoutbox_group_weight_module() {
db_query("UPDATE {system} SET weight = -5 WHERE name = 'shoutbox_group'");
}
function shoutbox_group_update_6200() {
db_query("UPDATE {shoutbox} s INNER JOIN {shoutbox_groups} sg ON s.shout_id = sg.shout_id SET s.module = 'shoutbox_group'");
return array();
}
function shoutbox_group_update_6201() {
shoutbox_group_weight_module();
return array();
}