You are here

function og_notifications_install in Organic groups 5.3

Same name and namespace in other branches
  1. 5.8 og_notifications/og_notifications.install \og_notifications_install()
  2. 6.2 modules/og_notifications/og_notifications.install \og_notifications_install()
  3. 6 modules/og_notifications/og_notifications.install \og_notifications_install()

Implementation of hook_install().

1 call to og_notifications_install()
og_notifications_update_5001 in og_notifications/og_notifications.install
Update function to quick-fix OG-D5 installations that already had this module enabled prior to the 5703 update.

File

og_notifications/og_notifications.install, line 6

Code

function og_notifications_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      db_query("CREATE TABLE {og_notifications} (\n        uid int NOT NULL,\n        autosubscribe tinyint NOT NULL DEFAULT -1,\n        PRIMARY KEY (uid)\n      ) /*!40100 DEFAULT CHARACTER SET utf8 */;");
      break;
    case 'pgsql':
      db_query("CREATE TABLE {og_notifications} (\n        uid int NOT NULL,\n        autosubscribe smallint NOT NULL DEFAULT -1,\n        PRIMARY KEY (uid)\n      );");
      break;
  }
  if (variable_get('og_notifications_update_required', FALSE)) {
    og_notifications_og_upgrade();
  }
  drupal_set_message(t('Organic groups notifications module installation script complete.'));
}