function blogapi_install in Drupal 5
Same name and namespace in other branches
- 6 modules/blogapi/blogapi.install \blogapi_install()
Implementation of hook_install().
File
- modules/
blogapi/ blogapi.install, line 6
Code
function blogapi_install() {
// Create table.
switch ($GLOBALS['db_type']) {
case 'mysql':
case 'mysqli':
db_query("CREATE TABLE {blogapi_files} (\n fid int NOT NULL auto_increment,\n uid int unsigned NOT NULL default 0,\n filepath varchar(255) NOT NULL default '',\n filesize int unsigned NOT NULL default 0,\n PRIMARY KEY (fid),\n KEY uid (uid)\n ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
break;
case 'pgsql':
db_query("CREATE TABLE {blogapi_files} (\n fid serial,\n uid int_unsigned NOT NULL default 0,\n filepath varchar(255) NOT NULL default '',\n filesize int_unsigned NOT NULL default 0,\n PRIMARY KEY (fid)\n )");
db_query("CREATE INDEX {blogapi_files}_uid_idx ON {blogapi_files} (uid)");
break;
}
}