You are here

function subscriptions_install in Subscriptions 5

Same name and namespace in other branches
  1. 5.2 subscriptions.install \subscriptions_install()
  2. 6 subscriptions.install \subscriptions_install()
  3. 7 subscriptions.install \subscriptions_install()
  4. 2.0.x subscriptions.install \subscriptions_install()

File

./subscriptions.install, line 2

Code

function subscriptions_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      db_query("CREATE TABLE {subscriptions_holding} (\n          rid int(11) NOT NULL auto_increment,\n          content blob NOT NULL,\n          ptype tinytext NOT NULL,\n          op tinytext NOT NULL,\n          pid int(11) NOT NULL default '0',\n          PRIMARY KEY  (`rid`)\n        ) TYPE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */;");
      db_query("CREATE TABLE {subscriptions} (\n          sid int(10) unsigned NOT NULL,\n          uid int(10) unsigned NOT NULL,\n          stype varchar(25) NOT NULL\n      ) TYPE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */;");
      drupal_set_message(t('Subscriptions database tables have been installed.'));
      break;
    case 'pgsql':
      db_query("CREATE TABLE {subscriptions_holding} (\n          rid serial NOT NULL,\n          content text NOT NULL,\n          ptype text NOT NULL,\n          op text NOT NULL,\n          pid integer NOT NULL default 0\n      )");
      db_query("CREATE TABLE {subscriptions} (\n          sid integer NOT NULL,\n          uid integer NOT NULL,\n          stype text NOT NULL\n      )");
      drupal_set_message(t('Subscriptions database tables have been installed.'));
      break;
  }
}