You are here

function location_phone_install in Location 5.3

Same name and namespace in other branches
  1. 5 contrib/location_phone/location_phone.install \location_phone_install()
  2. 6.3 contrib/location_phone/location_phone.install \location_phone_install()
  3. 7.5 contrib/location_phone/location_phone.install \location_phone_install()
  4. 7.3 contrib/location_phone/location_phone.install \location_phone_install()
  5. 7.4 contrib/location_phone/location_phone.install \location_phone_install()

Implementation of hook_install().

File

contrib/location_phone/location_phone.install, line 11
Installation routines.

Code

function location_phone_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      db_query("\n      CREATE TABLE {location_phone} (\n        lid int(10) unsigned NOT NULL default '0',\n        phone varchar(31) default NULL,\n        PRIMARY KEY  (lid)\n      ) /*!40100 DEFAULT CHARACTER SET utf8 */;\n      ");
      break;
    case 'pgsql':
      db_query("\n        CREATE TABLE {location_phone} (\n          lid int NOT NULL default '0' CHECK (lid >= 0),\n          phone varchar(31) default NULL,\n          PRIMARY KEY (lid)\n        )");
      break;
  }

  // Change weight.
  db_query("UPDATE {system} SET weight = 1 WHERE name = '%s' AND type = '%s'", 'location_phone', 'module');
  drupal_set_message(t('Installed tables for module location_phone'));
}