You are here

function spaces_install in Spaces 5

Same name and namespace in other branches
  1. 5.2 spaces.install \spaces_install()
  2. 6.3 spaces.install \spaces_install()
  3. 6 spaces.install \spaces_install()
  4. 6.2 spaces.install \spaces_install()
  5. 7.3 spaces.install \spaces_install()
  6. 7 spaces.install \spaces_install()

Implementaton of hook_install().

File

./spaces.install, line 6

Code

function spaces_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysqli':
    case 'mysql':
      db_query("UPDATE {system} SET weight = 20 WHERE name = 'spaces'");
      db_query("CREATE TABLE {spaces_features} (\n                gid int(10) NOT NULL default '0',\n                type int(1) NOT NULL default '0',\n                id longtext NOT NULL,\n                value longtext NOT NULL,\n                KEY (gid)\n                ) /*!40100 DEFAULT CHARACTER SET UTF8 */");
      db_query("CREATE TABLE {spaces_features_custom} (\n                gid int(10) NOT NULL default '0',\n                labels longtext NOT NULL,\n                weights longtext NOT NULL,\n                PRIMARY KEY  (gid)\n                ) /*!40100 DEFAULT CHARACTER SET UTF8 */");
      db_query("CREATE TABLE {spaces_features_ui} (\n                feature varchar(30) NOT NULL default '',\n                label varchar(255) NOT NULL default '',\n                description longtext,\n                PRIMARY KEY (feature)\n                ) /*!40100 DEFAULT CHARACTER SET UTF8 */");
  }
}