You are here

function services_install in Services 5

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

Implementation of hook_install().

File

./services.install, line 9
This install creates the tables which are required by the services module

Code

function services_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      db_query("CREATE TABLE {services_keys} (\n        kid varchar(32) NOT NULL default '',\n        title varchar(255) NOT NULL default '',\n        domain varchar(255) NOT NULL default '',\n        PRIMARY KEY (kid)\n      ) /*!40100 DEFAULT CHARACTER SET UTF8 */");
      db_query("CREATE TABLE {services_timestamp_nonce} (\n        timestamp varchar(32) NOT NULL default '',\n        domain varchar(255) NOT NULL default '',\n        nonce varchar(32) NOT NULL default ''\n      ) /*!40100 DEFAULT CHARACTER SET UTF8 */");
      break;
    case 'pgsql':
      db_query("CREATE TABLE {services_keys} (\n        kid varchar(32) NOT NULL default '',\n        title varchar(255) NOT NULL default '',\n        domain varchar(255) NOT NULL default '',\n        PRIMARY KEY (kid)\n      )");
      db_query("CREATE TABLE {services_timestamp_nonce} (\n        timestamp varchar(32) NOT NULL default '',\n        domain varchar(255) NOT NULL default '',\n        nonce varchar(32) NOT NULL default ''\n      )");
      break;
  }
}