aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-06-04 17:46:21 -0700
committerfriendica <info@friendica.com>2013-06-04 17:46:21 -0700
commit0deec983b475f30269cbf34606ec93fbad36a4a5 (patch)
treec5b26aa37b551aec4ba4a9324d04c45eddb84dd0
parent9f15600c7c426c4f557809ed2036802381e5bf12 (diff)
downloadvolse-hubzilla-0deec983b475f30269cbf34606ec93fbad36a4a5.tar.gz
volse-hubzilla-0deec983b475f30269cbf34606ec93fbad36a4a5.tar.bz2
volse-hubzilla-0deec983b475f30269cbf34606ec93fbad36a4a5.zip
DB: add timestamps to hubloc table so we can eventually expire dead entries.
-rwxr-xr-xboot.php2
-rw-r--r--install/database.sql8
-rw-r--r--install/update.php12
3 files changed, 18 insertions, 4 deletions
diff --git a/boot.php b/boot.php
index 15e442d65..d4add9cc9 100755
--- a/boot.php
+++ b/boot.php
@@ -41,7 +41,7 @@ require_once('include/features.php');
define ( 'RED_PLATFORM', 'Red Matrix' );
define ( 'RED_VERSION', trim(file_get_contents('version.inc')) . 'R');
define ( 'ZOT_REVISION', 1 );
-define ( 'DB_UPDATE_VERSION', 1042 );
+define ( 'DB_UPDATE_VERSION', 1043 );
define ( 'EOL', '<br />' . "\r\n" );
define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' );
diff --git a/install/database.sql b/install/database.sql
index 025bd3d39..33dd9f31b 100644
--- a/install/database.sql
+++ b/install/database.sql
@@ -193,7 +193,7 @@ CREATE TABLE IF NOT EXISTS `channel` (
KEY `channel_pageflags` (`channel_pageflags`),
KEY `channel_max_anon_mail` (`channel_max_anon_mail`),
KEY `channel_max_friend_req` (`channel_max_friend_req`),
- KEY `channel_default_group` (`channel_default_group`),
+ KEY `channel_default_gid` (`channel_default_group`),
KEY `channel_r_stream` (`channel_r_stream`),
KEY `channel_r_profile` (`channel_r_profile`),
KEY `channel_r_photos` (`channel_r_photos`),
@@ -373,13 +373,17 @@ CREATE TABLE IF NOT EXISTS `hubloc` (
`hubloc_callback` char(255) NOT NULL DEFAULT '',
`hubloc_connect` char(255) NOT NULL DEFAULT '',
`hubloc_sitekey` text NOT NULL,
+ `hubloc_updated` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
+ `hubloc_connected` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`hubloc_id`),
KEY `hubloc_url` (`hubloc_url`),
KEY `hubloc_guid` (`hubloc_guid`),
KEY `hubloc_flags` (`hubloc_flags`),
KEY `hubloc_connect` (`hubloc_connect`),
KEY `hubloc_host` (`hubloc_host`),
- KEY `hubloc_addr` (`hubloc_addr`)
+ KEY `hubloc_addr` (`hubloc_addr`),
+ KEY `hubloc_updated` (`hubloc_updated`),
+ KEY `hubloc_connected` (`hubloc_connected`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `intro` (
diff --git a/install/update.php b/install/update.php
index 8a225867e..382e8723c 100644
--- a/install/update.php
+++ b/install/update.php
@@ -1,6 +1,6 @@
<?php
-define( 'UPDATE_VERSION' , 1042 );
+define( 'UPDATE_VERSION' , 1043 );
/**
*
@@ -531,3 +531,13 @@ function update_r1041() {
return UPDATE_FAILED;
}
+
+function update_r1042() {
+ $r = q("ALTER TABLE `hubloc` ADD `hubloc_updated` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
+ADD `hubloc_connected` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', ADD INDEX ( `hubloc_updated` ), ADD INDEX ( `hubloc_connected` )");
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+