You are here

subscriptions.install in Subscriptions 5

File

subscriptions.install
View source
<?php

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;
  }
}

Functions