function content_install in Content Construction Kit (CCK) 5
Same name and namespace in other branches
- 6.3 content.install \content_install()
- 6 content.install \content_install()
- 6.2 content.install \content_install()
Implementation of hook_install().
The 4.7 install file had creation text for a node_type table that is now created by core. The install script for that table has been removed from the 5.x branch install file. Refer to the 4.7 install file to see the original database configuration script.
File
- ./
content.install, line 10
Code
function content_install() {
switch ($GLOBALS['db_type']) {
case 'mysql':
case 'mysqli':
db_query("CREATE TABLE {node_field} (\n field_name varchar(32) NOT NULL default '',\n type varchar(127) NOT NULL default '',\n global_settings mediumtext NOT NULL,\n required int NOT NULL default '0',\n multiple int NOT NULL default '0',\n db_storage int NOT NULL default '0',\n PRIMARY KEY (field_name)\n ) /*!40100 DEFAULT CHARACTER SET utf8 */");
db_query("CREATE TABLE {node_field_instance} (\n field_name varchar(32) NOT NULL default '',\n type_name varchar(32) NOT NULL default '',\n weight int NOT NULL default '0',\n label varchar(255) NOT NULL default '',\n widget_type varchar(32) NOT NULL default '',\n widget_settings mediumtext NOT NULL,\n display_settings mediumtext NOT NULL,\n description mediumtext NOT NULL,\n PRIMARY KEY (field_name,type_name)\n ) /*!40100 DEFAULT CHARACTER SET utf8 */");
db_query("CREATE TABLE {cache_content} (\n cid varchar(255) NOT NULL default '',\n data longblob,\n expire int NOT NULL default '0',\n created int NOT NULL default '0',\n headers text,\n PRIMARY KEY (cid),\n INDEX expire (expire)\n ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
break;
case 'pgsql':
db_query("CREATE TABLE {node_field} (\n field_name varchar(32) NOT NULL default '',\n type varchar(127) NOT NULL default '',\n global_settings text NOT NULL,\n required integer NOT NULL default '0',\n multiple integer NOT NULL default '0',\n db_storage integer NOT NULL default '0',\n PRIMARY KEY (field_name)\n )");
db_query("CREATE TABLE {node_field_instance} (\n field_name varchar(32) NOT NULL default '',\n type_name varchar(32) NOT NULL default '',\n weight integer NOT NULL default '0',\n label varchar(255) NOT NULL default '',\n widget_type varchar(32) NOT NULL default '',\n widget_settings text NOT NULL,\n display_settings text NOT NULL,\n description text NOT NULL,\n PRIMARY KEY (field_name,type_name)\n )");
db_query("CREATE TABLE {cache_content} (\n cid varchar(255) NOT NULL default '',\n data bytea,\n expire int NOT NULL default '0',\n created int NOT NULL default '0',\n headers text,\n PRIMARY KEY (cid)\n )");
db_query("CREATE INDEX {cache_content}_expire_idx ON {cache_content} (expire)");
break;
}
variable_set('content_schema_version', 1003);
}