aboutsummaryrefslogtreecommitdiffstats
path: root/install
diff options
context:
space:
mode:
Diffstat (limited to 'install')
-rw-r--r--install/database.sql18
-rw-r--r--install/update.php13
2 files changed, 21 insertions, 10 deletions
diff --git a/install/database.sql b/install/database.sql
index 2d8475741..aee87c119 100644
--- a/install/database.sql
+++ b/install/database.sql
@@ -16,7 +16,7 @@ CREATE TABLE IF NOT EXISTS `abook` (
`abook_closeness` tinyint(3) unsigned NOT NULL DEFAULT '99',
`abook_created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`abook_updated` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
- `abook_connnected` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
+ `abook_connected` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`abook_dob` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`abook_flags` int(11) NOT NULL DEFAULT '0',
`abook_profile` char(64) NOT NULL DEFAULT '',
@@ -29,10 +29,10 @@ CREATE TABLE IF NOT EXISTS `abook` (
KEY `abook_closeness` (`abook_closeness`),
KEY `abook_created` (`abook_created`),
KEY `abook_updated` (`abook_updated`),
- KEY `abook_connnected` (`abook_connnected`),
KEY `abook_flags` (`abook_flags`),
KEY `abook_profile` (`abook_profile`),
- KEY `abook_dob` (`abook_dob`)
+ KEY `abook_dob` (`abook_dob`),
+ KEY `abook_connected` (`abook_connected`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `account` (
@@ -241,7 +241,6 @@ CREATE TABLE IF NOT EXISTS `event` (
`deny_gid` mediumtext NOT NULL,
PRIMARY KEY (`id`),
KEY `uid` (`uid`),
- KEY `event_xchan` (`event_xchan`),
KEY `type` (`type`),
KEY `start` (`start`),
KEY `finish` (`finish`),
@@ -249,8 +248,9 @@ CREATE TABLE IF NOT EXISTS `event` (
KEY `nofinish` (`nofinish`),
KEY `ignore` (`ignore`),
KEY `aid` (`aid`),
- KEY `event_hash` (`event_hash`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+ KEY `event_hash` (`event_hash`),
+ KEY `event_xchan` (`event_xchan`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `fcontact` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
@@ -649,14 +649,14 @@ CREATE TABLE IF NOT EXISTS `photo` (
`deny_gid` mediumtext NOT NULL,
PRIMARY KEY (`id`),
KEY `uid` (`uid`),
- KEY `resource_id` (`resource_id`),
KEY `album` (`album`),
KEY `scale` (`scale`),
KEY `profile` (`profile`),
KEY `type` (`type`),
KEY `aid` (`aid`),
KEY `xchan` (`xchan`),
- KEY `size` (`size`)
+ KEY `size` (`size`),
+ KEY `resource_id` (`resource_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `profile` (
@@ -842,7 +842,7 @@ CREATE TABLE IF NOT EXISTS `verify` (
KEY `token` (`token`),
KEY `meta` (`meta`),
KEY `created` (`created`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `xchan` (
`xchan_hash` char(255) NOT NULL,
diff --git a/install/update.php b/install/update.php
index 8decfc133..41c6a7565 100644
--- a/install/update.php
+++ b/install/update.php
@@ -1,6 +1,6 @@
<?php
-define( 'UPDATE_VERSION' , 1021 );
+define( 'UPDATE_VERSION' , 1022 );
/**
*
@@ -292,3 +292,14 @@ function update_r1020() {
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}
+
+function update_r1021() {
+
+ $r = q("ALTER TABLE `abook` CHANGE `abook_connnected` `abook_connected` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
+ drop index `abook_connnected`, add index ( `abook_connected` ) ");
+
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+