You are here

function fillpdf_install in FillPDF 5

Same name and namespace in other branches
  1. 6 fillpdf.install \fillpdf_install()
  2. 7.2 fillpdf.install \fillpdf_install()
  3. 7 fillpdf.install \fillpdf_install()

File

./fillpdf.install, line 3

Code

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;
  }
}