You are here

function ad_text_install in Advertisement 5.2

Same name and namespace in other branches
  1. 5 text/ad_text.install \ad_text_install()
  2. 6.3 text/ad_text.install \ad_text_install()
  3. 6 text/ad_text.install \ad_text_install()
  4. 6.2 text/ad_text.install \ad_text_install()

Ad_text module database schema. Copyright (c) 2005-2006 Jeremy Andrews <jeremy@kerneltrap.org>. All rights reserved.

File

text/ad_text.install, line 9

Code

function ad_text_install() {
  switch ($GLOBALS['db_type']) {
    case 'pgsql':

      /**
       * The ad_text table stores each line of the actual text ad.
       */
      db_query("CREATE TABLE {ad_text} (\n        aid INT NOT NULL DEFAULT '0' PRIMARY KEY,\n\n        url VARCHAR(255) NOT NULL DEFAULT '',\n        adheader VARCHAR(255) NOT NULL DEFAULT '',\n        adbody TEXT NOT NULL DEFAULT ''\n      );");
      break;
    case 'mysql':
    case 'mysqli':
    default:

      /**
       * The ad_text table stores each line of the actual text ad.
       */
      db_query("CREATE TABLE {ad_text} (\n        aid INT(10) UNSIGNED NOT NULL DEFAULT '0',\n\n        url VARCHAR(255) NOT NULL DEFAULT '',\n        adheader VARCHAR(255) NOT NULL DEFAULT '',\n        adbody TEXT NULL,\n\n        PRIMARY KEY (aid)\n      ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
  }
  drupal_set_message(t('The necessary ad_text module tables have been created.'));
}