You are here

function fieldgroup_install in Content Construction Kit (CCK) 5

Same name and namespace in other branches
  1. 6.3 modules/fieldgroup/fieldgroup.install \fieldgroup_install()
  2. 6 modules/fieldgroup/fieldgroup.install \fieldgroup_install()
  3. 6.2 modules/fieldgroup/fieldgroup.install \fieldgroup_install()

File

./fieldgroup.install, line 3

Code

function fieldgroup_install() {
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      db_query("CREATE TABLE {node_group} (\n                `type_name` varchar(32) NOT NULL default '',\n                `group_name` varchar(32) NOT NULL default '',\n                `label` varchar(255) NOT NULL default '',\n                `settings` mediumtext NOT NULL,\n                `weight` tinyint(4) NOT NULL,\n                 PRIMARY KEY(`type_name`, `group_name`)\n              ) /*!40100 DEFAULT CHARACTER SET utf8 */");
      db_query("CREATE TABLE {node_group_fields} (\n                `type_name` varchar(32) NOT NULL default '',\n                `group_name` varchar(32) NOT NULL default '',\n                `field_name` varchar(32) NOT NULL default '',\n                 PRIMARY KEY(`type_name`, `group_name`, `field_name`)\n              ) /*!40100 DEFAULT CHARACTER SET utf8 */");
      break;
    case 'pgsql':
      db_query("CREATE TABLE {node_group} (\n                type_name varchar(32) NOT NULL default '',\n                group_name varchar(32) NOT NULL default '',\n                label varchar(255) NOT NULL default '',\n                settings text NOT NULL,\n                weight smallint NOT NULL,\n                PRIMARY KEY(type_name, group_name)\n      )");
      db_query("CREATE TABLE {node_group_fields} (\n                type_name varchar(32) NOT NULL default '',\n                group_name varchar(32) NOT NULL default '',\n                field_name varchar(32) NOT NULL default '',\n                PRIMARY KEY(type_name, group_name, field_name)\n      )");
      break;
  }
  db_query("UPDATE {system} SET weight = 9 WHERE name = 'fieldgroup'");
}