You are here

function formdefaults_install in Form Defaults 5

Same name and namespace in other branches
  1. 8 formdefaults.install \formdefaults_install()
  2. 5.3 formdefaults.install \formdefaults_install()
  3. 5.2 formdefaults.install \formdefaults_install()
  4. 6.2 formdefaults.install \formdefaults_install()
  5. 6 formdefaults.install \formdefaults_install()
  6. 7 formdefaults.install \formdefaults_install()

File

./formdefaults.install, line 2

Code

function formdefaults_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      db_query("CREATE TABLE {formdefaults_forms} (\n                formid varchar(255),\n                formdata longtext,\n                key fromid (formid)\n                ) TYPE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */;");
      break;
    case 'pgsql':
      db_query("CREATE TABLE {formdefaults_forms} (\n                  formid varchar(255),\n                  formdata text,\n                  PRIMARY KEY (formid)\n                );");
      break;
  }
  db_query("UPDATE {system} SET weight = 20 WHERE name = 'formdefaults'");
}