You are here

fillpdf.install in FillPDF 5

File

fillpdf.install
View source
<?php

function fillpdf_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysqli':
    case 'mysql':
      db_query("CREATE TABLE if not exists {fillpdf_forms} (\n        fid int(10) unsigned NOT NULL,\n        title varchar(255) NOT NULL,\n        url varchar(255) NOT NULL,\t\t\n        PRIMARY KEY(fid)\n      ) TYPE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */;");
      db_query("CREATE TABLE if not exists {fillpdf_fields} (\n        fid int(10) unsigned NOT NULL,\n\t\tpdf_key varchar(255) NOT NULL,\t\t\n        label varchar(255) NOT NULL,\n\t\tvalue mediumtext NOT NULL,\t\t\n        PRIMARY KEY(fid, pdf_key)\n      ) TYPE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */;");
      break;
    case 'pgsql':
      db_query("CREATE TABLE {fillpdf_forms} (\n        fid integer NOT NULL,\n        title varchar(255) NOT NULL,\n        url varchar(255) NOT NULL,\t\t\n        PRIMARY KEY(fid)\n      )");
      db_query("CREATE TABLE {fillpdf_fields} (\n        fid integer NOT NULL,\n        pdf_key varchar(255) NOT NULL,\t\t\n        label varchar(255) NOT NULL,\n\t\tvalue mediumtext NOT NULL,\t\n        PRIMARY KEY(fid, pdf_key)\n      )");
    default:
      break;
  }
}
function fillpdf_uninstall() {
  db_query("DROP TABLE {fillpdf_forms}");
  db_query("DROP TABLE {fillpdf_fields}");
}

Functions