replication.install in Replication 5
File
replication.install
View source
<?php
function replication_install() {
switch ($GLOBALS['db_type']) {
case 'mysql':
case 'mysqli':
db_query("CREATE TABLE {replication} (\n `slaveid` varchar(10) NOT NULL,\n `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,\n PRIMARY KEY (`slaveid`)\n ) /*!40100 DEFAULT CHARACTER SET utf8 */");
drupal_set_message("Please ensure that you correctly patch your includes/database.mysql.inc files!");
break;
case 'pgsql':
drupal_set_message("Your database is not supported by this module");
break;
}
}
function replication_uninstall() {
db_query("DROP TABLE {replication}");
variable_del('replication_online');
variable_del('replication_admin_identifier');
variable_del('replication_admin_normal_theme');
variable_del('replication_admin_warning_theme');
variable_del('replication_admin_max_recheck');
variable_del('replication_admin_wait_recheck');
variable_del('replication_server_mode');
variable_del('replication_server_url');
variable_del('replication_http_timeout');
variable_del('replication_http_speedlimit');
variable_del('replication_http_retries');
variable_del('replication_http_port');
variable_del('replication_http_connect');
variable_del('replication_timestamp');
}
function replication_update_1() {
switch ($GLOBALS['db_type']) {
case 'mysql':
case 'mysqli':
$ret[] = update_sql("CREATE TABLE {replication} (\n `slaveid` varchar(10) NOT NULL,\n `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,\n PRIMARY KEY (`slaveid`)\n ) /*!40100 DEFAULT CHARACTER SET utf8 */");
drupal_set_message("Please ensure that you correctly patch your includes/database.mysql.inc files!");
break;
case 'pgsql':
drupal_set_message("Your database is not supported by this module");
break;
}
return $ret;
}