You are here

function comment_upload_install in Comment Upload 5

Same name and namespace in other branches
  1. 6 comment_upload.install \comment_upload_install()

File

./comment_upload.install, line 3

Code

function comment_upload_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      db_query("CREATE TABLE {comment_upload_files} (\n           fid int(10) unsigned NOT NULL default '0',\n           nid int(10) unsigned NOT NULL default '0',\n           cid int unsigned NOT NULL default '0',\n           filename varchar(255) NOT NULL default '',\n           filepath varchar(255) NOT NULL default '',\n           filemime varchar(255) NOT NULL default '',\n           filesize int(10) unsigned NOT NULL default '0',\n           description varchar(255) NOT NULL default '',\n           list tinyint(1) unsigned NOT NULL default 0,\n           PRIMARY KEY (fid),\n           INDEX (nid),\n           INDEX cid_fid (cid, fid)\n        ) /*!40100 DEFAULT CHARACTER SET utf8 */;");
      break;
    case 'pgsql':
      db_query("CREATE TABLE {comment_upload_files} (\n         fid serial CHECK (fid >= 0),\n         nid int_unsigned NOT NULL default 0,\n         cid int_unsigned NOT NULL default 0,\n         filename varchar(255) NOT NULL default '',\n         filepath varchar(255) NOT NULL default '',\n         filemime varchar(255) NOT NULL default '',\n         filesize int_unsigned NOT NULL default 0,\n         description varchar(255) NOT NULL default '',\n         list smallint_unsigned NOT NULL default 0,\n         PRIMARY KEY (fid)\n      )");
      db_query("CREATE INDEX {comment_upload_files}_nid_idx ON {comment_upload_files} (nid)");
      break;
  }
}