follow.install in Follow 5
Same filename and directory in other branches
Follow module's install and uninstall code.
File
follow.installView source
<?php
/**
* @file
* Follow module's install and uninstall code.
*/
/**
* Implementation of hook_install().
*/
function follow_install() {
// Create the schema.
db_query("CREATE TABLE {follow_links} (\n lid int(10) unsigned NOT NULL auto_increment,\n name varchar(255) NOT NULL default '',\n uid int(11) NOT NULL default '0',\n path varchar(255) NOT NULL default '',\n options text,\n title varchar(255) NOT NULL default '',\n weight tinyint(4) NOT NULL default '0',\n PRIMARY KEY (lid),\n UNIQUE KEY (uid,name)\n )");
// Add a default link to this site's node RSS feed.
db_query("INSERT INTO {follow_links} (name,path,options,uid,weight,title) VALUES('this-site', 'rss.xml', 'a:0:{}', 0, 0, '')");
}
/**
* Implementation of hook_uninstall().
*/
function follow_uninstall() {
// Remove the schema.
db_query('DROP TABLE {follow_links}');
variable_del('follow_user_block_title');
variable_del('follow_site_block_title');
variable_del('follow_site_block_user');
}
/**
* Add the title column.
*/
function follow_update_5000() {
$ret = array();
$ret[] = update_sql("ALTER TABLE {follow_links} ADD title varchar(255) default '' NOT NULL");
return $ret;
}
Functions
Name | Description |
---|---|
follow_install | Implementation of hook_install(). |
follow_uninstall | Implementation of hook_uninstall(). |
follow_update_5000 | Add the title column. |