aboutsummaryrefslogtreecommitdiffstats
path: root/install
diff options
context:
space:
mode:
Diffstat (limited to 'install')
-rw-r--r--install/INSTALL.txt183
-rw-r--r--install/database.sql497
-rwxr-xr-x[-rw-r--r--]install/htconfig.sample.php58
-rw-r--r--install/update.php876
4 files changed, 1363 insertions, 251 deletions
diff --git a/install/INSTALL.txt b/install/INSTALL.txt
index e6adbba7d..6080ff6c7 100644
--- a/install/INSTALL.txt
+++ b/install/INSTALL.txt
@@ -1,61 +1,131 @@
-Friendica Installation
+Red Matrix Installation
-We've tried very hard to ensure that Friendica will run on commodity hosting
-platforms - such as those used to host Wordpress blogs and Drupal websites.
-But be aware that Friendica is more than a simple web application. It is a
+We've tried very hard to ensure that the Red Matrix will run on commodity
+hosting platforms - such as those used to host Wordpress blogs and Drupal
+websites. It will run on most any Linux VPS system. Windows LAMP platforms
+such as XAMPP and WAMP are not officially supported at this time - however
+we welcome patches if you manage to get it working.
+
+Be aware that the Red Matrix is more than a simple web application. It is a
complex communications system which more closely resembles an email server
than a web server. For reliability and performance, messages are delivered in
the background and are queued for later delivery when sites are down. This
kind of functionality requires a bit more of the host system than the typical
-blog. Not every PHP/MySQL hosting provider will be able to support Friendica.
-Many will. But please review the requirements and confirm these with your
-hosting provider prior to installation.
+blog. Not every PHP/MySQL hosting provider will be able to support the
+Red Matrix. Many will - but please review the requirements and confirm these
+with your hosting provider prior to installation. (And preferably before
+entering into a long-term contract.)
+
+If you encounter installation issues, please let us know via the Github issue
+tracker (https://github.com/friendica/red/issues). Please be as clear as you
+can about your operating environment and provide as much detail as possible
+about any error messages you may see, so that we can prevent it from happening
+in the future. Due to the large variety of operating systems and PHP platforms
+in existence we may have only limited ability to debug your PHP installation or
+acquire any missing modules - but we will do our best to solve any general code
+issues.
+
+
Before you begin: Choose a domain name or subdomain name for your server.
-Put some thought into this - because changing it is currently not-supported.
-Things will break, and some of your friends may have difficulty communicating
-with you. We plan to address this limitation in a future release. Also decide
-if you wish to connect with members of the Diaspora network, as this will
-impact the installation requirements.
-
-Decide if you will use SSL and obtain an SSL cert. Communications with the
-Diaspora network MAY require both SSL AND an SSL cert signed by a CA which is
-recognised by the major browsers. Friendica will work with self-signed certs
-but Diaspora communication may not. For best results, install your cert PRIOR
-to installing Friendica and when visiting your site for the initial
-installation in step 5, please use the https: link. (Use the http: or non-SSL
-link if your cert is self-signed).
+
+The Red Matrix can only be installed into the root of a domain or
+sub-domain, and can not be installed using alternate TCP ports.
+
+Decide if you will use SSL and obtain an SSL certificate before software
+installation. You SHOULD use SSL. If you use SSL, you MUST use a
+"browser-valid" certificate. You MUST NOT use self-signed certificates!
+
+Please test your certificate prior to installation. A web tool for testing your
+certificate is available at "http://www.digicert.com/help/". When visiting your
+site for the first time, please use the SSL ("https://") URL if SSL is
+available. This will avoid problems later. The installation routine will not
+allow you to use a non browser-valid certificate.
+
+This restriction is incorporated because public posts from you may for example
+contain references to images on your own hub. If your certificate is not known
+by the internet browser of users they get a warning message complaining about
+some security issues. Although these complains are not the real truth - there
+are no security issues with your encryption! - the users may be confused,
+nerved or even worse may become scared about Red Matrix having security issues.
+Free "browser-valid" certificates are available from providers such as StartSSL.
+If you do NOT use SSL, there may be a delay of up to a minute for the initial
+install script - while we check the SSL port to see if anything responds there.
+When communicating with new sites, Red Matrix always attempts connection on the
+SSL port first, before falling back to a less secure connection.
1. Requirements
- - Apache with mod-rewrite enabled and "Options All" so you can use a
+ - Apache with mod-rewrite enabled and "AllowOverride All" so you can use a
local .htaccess file
- PHP 5.3+. The later the better.
- PHP *command line* access with register_argc_argv set to true in the
-php.ini file [or see 'poormancron' in section 8]
+php.ini file - and with no hosting provider restrictions on the use of exec()
+and proc_open().
- - curl, gd (with at least jpeg support), mysql, mbstring, mcrypt, and openssl extensions
+ - curl, gd (with at least jpeg support), mysqli, mbstring, mcrypt, and openssl extensions. The imagick extension is not required but desirable.
- some form of email server or email gateway such that PHP mail() works
- - Mysql 5.x
+ - Mysql 5.x or MariaDB
- - ability to schedule jobs with cron (Linux/Mac) or Scheduled Tasks
-(Windows) [Note: other options are presented in Section 8 of this document]
+ - ability to schedule jobs with cron.
- Installation into a top-level domain or sub-domain (without a
-directory/path component in the URL) is preferred. This is REQUIRED if
-you wish to communicate with the Diaspora network.
+directory/path component in the URL) is REQUIRED.
-2. Unpack the Friendica files into the root of your web server document area.
+2. Unpack the Red Matrix files into the root of your web server document area.
- If you copy the directory tree to your webserver, make sure
that you also copy .htaccess - as "dot" files are often hidden
and aren't normally copied.
+ - If you are able to do so, we recommend using git to clone the
+ source repository rather than to use a packaged tar or zip file.
+ This makes the software much easier to update. The Linux command
+ to clone the repository into a directory "mywebsite" would be
+
+ git clone https://github.com/friendica/red.git mywebsite
+
+ - and then you can pick up the latest changes at any time with
+
+ git pull
+
+ - make sure folders *view/tpl/smarty3* and *store* exist and are writable by webserver
+
+ mkdir view/tpl/smarty3
+ mkdir store
+
+ chmod 777 view/tpl/smarty3
+ chmod 777 store
+
+ [This permission (777) is very dangerous and if you have sufficient
+ privilege and knowledge you should make this directory writeable only
+ by the webserver. In many shared hosting environments this may be
+ difficult without opening a trouble ticket with your provider. The
+ above permissions will allow the software to work, but are not
+ optimal.]
+
+ - For installing addons
+
+ - First you should be **on** your website folder
+
+ cd mywebsite
+
+ - Then you should clone the addon repository (separately)
+
+ git clone https://github.com/friendica/red-addons.git addon
+
+ - For keeping the addon tree updated, you should be on you addon tree and issue a git pull
+
+ cd mywebsite/addon
+
+ git pull
+
+
3. Create an empty database and note the access details (hostname, username,
password, database name).
@@ -66,8 +136,8 @@ write or create files in your web directory, create an empty file called
5. Visit your website with a web browser and follow the instructions. Please
note any error messages and correct these before continuing. If you are using
-SSL with a known signature authority (recommended), use the https: link to your
-website. If you are using a self-signed cert or no cert, use the http: link.
+SSL with a known signature authority, use the https: link to your
+website.
6. *If* the automated installation fails for any reason, check the following:
@@ -107,29 +177,11 @@ You can generally find the location of PHP by executing "which php". If you
have troubles with this section please contact your hosting provider for
assistance. Friendica will not work correctly if you cannot perform this step.
-You should also be sure that $a->config['php_path'] is set correctly, it should
+You should also be sure that $a->config['system']['php_path'] is set correctly, it should
look like (changing it to the correct PHP location)
-$a->config['php_path'] = '/usr/local/php53/bin/php'
+$a->config['system']['php_path'] = '/usr/local/php53/bin/php';
-Alternative: You may be able to use the 'poormancron' plugin to perform this
-step if you are using a recent Friendica release. 'poormancron' may result in
-perfomance and memory issues and is only suitable for small sites with one or
-two users and a handful of contacts. To do this, edit the file
-".htconfig.php" and look for a line describing your plugins. On a fresh
-installation, it will look like
-
-$a->config['system']['addon'] = 'js_upload';
-
-This indicates the "js_upload" addon module is enabled. You may add additional
-addons/plugins using this same line in the configuration file. Change it to
-read
-
-$a->config['system']['addon'] = 'js_upload,poormancron';
-
-and save your changes.
-
-
#####################################################################
@@ -145,7 +197,7 @@ and save your changes.
Check your database settings. It usually means your database could not
be opened or accessed. If the database resides on the same machine, check that
-the database server name is "localhost".
+the database server name is the word "localhost".
#####################################################################
- 500 Internal Error
@@ -153,8 +205,6 @@ the database server name is "localhost".
This could be the result of one of our Apache directives not being
supported by your version of Apache. Examine your apache server logs.
- You might remove the line "Options -Indexes" from the .htaccess file if
-you are using a Windows server as this has been known to cause problems.
Also check your file permissions. Your website and all contents must generally
be world-readable.
@@ -191,7 +241,7 @@ configuration for your site. This will need to be changed to
If you do not see the word "test", your .htaccess is working, but it is
likely that mod-rewrite is not installed in your web server or is not working.
- On most flavour of Linux,
+ On most flavours of Linux,
% a2enmod rewrite
% /etc/init.d/apache2 restart
@@ -200,8 +250,7 @@ likely that mod-rewrite is not installed in your web server or is not working.
distribution or (if Windows) the provider of your Apache server software if
you need to change either of these and can not figure out how. There is
a lot of help available on the web. Google "mod-rewrite" along with the
-name of your operating system distribution or Apache package (if using
-Windows).
+name of your operating system distribution or Apache package.
#####################################################################
@@ -223,7 +272,7 @@ Retry the installation. As soon as the database has been created,
#####################################################################
- Some configurations with "suhosin" security are configured without
-an ability to run external processes. Friendica requires this ability.
+an ability to run external processes. The Red Matrix requires this ability.
Following are some notes provided by one of our members.
#####################################################################
@@ -233,26 +282,26 @@ certain functions like proc_open, as configured in /etc/php5/conf.d/suhosin.ini:
suhosin.executor.func.blacklist = proc_open, ...
-For those sites like Friendica that really need these functions they can be
-enabled, e.g. in /etc/apache2/sites-available/friendica:
+For those sites like Red Matrix that really need these functions they can be
+enabled, e.g. in /etc/apache2/sites-available/redmatrix:
- <Directory /var/www/friendica/>
+ <Directory /var/www/redmatrix/>
php_admin_value suhosin.executor.func.blacklist none
php_admin_value suhosin.executor.eval.blacklist none
</Directory>
-This enables every function for Friendica if accessed via browser, but not for
+This enables every function for Red Matrix if accessed via browser, but not for
the cronjob that is called via php command line. I attempted to enable it for
cron by using something like
- */10 * * * * cd /var/www/friendica/friendica/ && sudo -u www-data /usr/bin/php
+ */10 * * * * cd /var/www/redmatrix/ && sudo -u www-data /usr/bin/php
-d suhosin.executor.func.blacklist=none -d suhosin.executor.eval.blacklist=none
-f include/poller.php
-This worked well for simple test cases, but the friendica-cron still failed with
+This worked well for simple test cases, but the cron job still failed with
a fatal error:
suhosin[22962]: ALERT - function within blacklist called: proc_open() (attacker
-'REMOTE_ADDR not set', file '/var/www/friendica/friendica/boot.php', line 1341)
+'REMOTE_ADDR not set', file '/var/www/redmatrix/boot.php', line 1341)
After a while I noticed, that include/poller.php calls further php script via
proc_open. These scripts themselves also use proc_open and fail, because they
@@ -260,11 +309,11 @@ are NOT called with -d suhosin.executor.func.blacklist=none.
So the simple solution is to put the correct parameters into .htconfig.php:
// Location of PHP command line processor
- $a->config['php_path'] = '/usr/bin/php -d suhosin.executor.func.blacklist=none
+ $a->config['system']['php_path'] = '/usr/bin/php -d suhosin.executor.func.blacklist=none
-d suhosin.executor.eval.blacklist=none';
-This is obvious as soon as you notice that the friendica-cron uses proc_open to
+This is obvious as soon as you notice that the cron uses proc_open to
execute php-scripts that also use proc_open, but it took me quite some time to
find that out. I hope this saves some time for other people using suhosin with
function blacklists.
diff --git a/install/database.sql b/install/database.sql
index 3dcbb7be0..82c96019e 100644
--- a/install/database.sql
+++ b/install/database.sql
@@ -44,6 +44,7 @@ CREATE TABLE IF NOT EXISTS `account` (
`account_salt` char(32) NOT NULL DEFAULT '',
`account_password` char(255) NOT NULL DEFAULT '',
`account_email` char(255) NOT NULL DEFAULT '',
+ `account_external` char(255) NOT NULL DEFAULT '',
`account_language` char(16) NOT NULL DEFAULT 'en',
`account_created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`account_lastlog` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
@@ -53,6 +54,7 @@ CREATE TABLE IF NOT EXISTS `account` (
`account_expires` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`account_expire_notified` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`account_service_class` char(32) NOT NULL DEFAULT '',
+ `account_level` int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`account_id`),
KEY `account_email` (`account_email`),
KEY `account_service_class` (`account_service_class`),
@@ -61,7 +63,9 @@ CREATE TABLE IF NOT EXISTS `account` (
KEY `account_roles` (`account_roles`),
KEY `account_lastlog` (`account_lastlog`),
KEY `account_expires` (`account_expires`),
- KEY `account_default_channel` (`account_default_channel`)
+ KEY `account_default_channel` (`account_default_channel`),
+ KEY `account_external` (`account_external`),
+ KEY `account_level` (`account_level`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `addon` (
@@ -78,11 +82,39 @@ CREATE TABLE IF NOT EXISTS `addon` (
KEY `installed` (`installed`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+CREATE TABLE IF NOT EXISTS `app` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `app_id` char(255) NOT NULL DEFAULT '',
+ `app_sig` char(255) NOT NULL DEFAULT '',
+ `app_author` char(255) NOT NULL DEFAULT '',
+ `app_name` char(255) NOT NULL DEFAULT '',
+ `app_desc` text NOT NULL,
+ `app_url` char(255) NOT NULL DEFAULT '',
+ `app_photo` char(255) NOT NULL DEFAULT '',
+ `app_version` char(255) NOT NULL DEFAULT '',
+ `app_channel` int(11) NOT NULL DEFAULT '0',
+ `app_addr` char(255) NOT NULL DEFAULT '',
+ `app_price` char(255) NOT NULL DEFAULT '',
+ `app_page` char(255) NOT NULL DEFAULT '',
+ `app_requires` char(255) NOT NULL DEFAULT '',
+ PRIMARY KEY (`id`),
+ KEY `app_id` (`app_id`),
+ KEY `app_name` (`app_name`),
+ KEY `app_url` (`app_url`),
+ KEY `app_photo` (`app_photo`),
+ KEY `app_version` (`app_version`),
+ KEY `app_channel` (`app_channel`),
+ KEY `app_price` (`app_price`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+
CREATE TABLE IF NOT EXISTS `attach` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`aid` int(10) unsigned NOT NULL DEFAULT '0',
`uid` int(10) unsigned NOT NULL DEFAULT '0',
`hash` char(64) NOT NULL DEFAULT '',
+ `creator` char(128) NOT NULL DEFAULT '',
`filename` char(255) NOT NULL DEFAULT '',
`filetype` char(64) NOT NULL DEFAULT '',
`filesize` int(10) unsigned NOT NULL DEFAULT '0',
@@ -107,7 +139,8 @@ CREATE TABLE IF NOT EXISTS `attach` (
KEY `edited` (`edited`),
KEY `revision` (`revision`),
KEY `folder` (`folder`),
- KEY `flags` (`flags`)
+ KEY `flags` (`flags`),
+ KEY `creator` (`creator`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `auth_codes` (
@@ -126,16 +159,6 @@ CREATE TABLE IF NOT EXISTS `cache` (
PRIMARY KEY (`k`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-CREATE TABLE IF NOT EXISTS `challenge` (
- `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
- `challenge` char(255) NOT NULL,
- `dfrn-id` char(255) NOT NULL,
- `expire` int(11) NOT NULL,
- `type` char(255) NOT NULL,
- `last_update` char(255) NOT NULL,
- PRIMARY KEY (`id`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
CREATE TABLE IF NOT EXISTS `channel` (
`channel_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`channel_account_id` int(10) unsigned NOT NULL DEFAULT '0',
@@ -153,37 +176,40 @@ CREATE TABLE IF NOT EXISTS `channel` (
`channel_prvkey` text NOT NULL,
`channel_notifyflags` int(10) unsigned NOT NULL DEFAULT '65535',
`channel_pageflags` int(10) unsigned NOT NULL DEFAULT '0',
+ `channel_dirdate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`channel_deleted` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`channel_max_anon_mail` int(10) unsigned NOT NULL DEFAULT '10',
`channel_max_friend_req` int(10) unsigned NOT NULL DEFAULT '10',
`channel_expire_days` int(11) NOT NULL DEFAULT '0',
`channel_passwd_reset` char(255) NOT NULL DEFAULT '',
- `channel_default_gid` int(10) unsigned NOT NULL DEFAULT '0',
+ `channel_default_group` char(255) NOT NULL DEFAULT '',
`channel_allow_cid` mediumtext NOT NULL,
`channel_allow_gid` mediumtext NOT NULL,
`channel_deny_cid` mediumtext NOT NULL,
`channel_deny_gid` mediumtext NOT NULL,
- `channel_r_stream` tinyint(3) unsigned NOT NULL DEFAULT '128',
- `channel_r_profile` tinyint(3) unsigned NOT NULL DEFAULT '128',
- `channel_r_photos` tinyint(3) unsigned NOT NULL DEFAULT '128',
- `channel_r_abook` tinyint(3) unsigned NOT NULL DEFAULT '128',
- `channel_w_stream` tinyint(3) unsigned NOT NULL DEFAULT '128',
- `channel_w_wall` tinyint(3) unsigned NOT NULL DEFAULT '128',
- `channel_w_tagwall` tinyint(3) unsigned NOT NULL DEFAULT '128',
- `channel_w_comment` tinyint(3) unsigned NOT NULL DEFAULT '128',
- `channel_w_mail` tinyint(3) unsigned NOT NULL DEFAULT '128',
- `channel_w_photos` tinyint(3) unsigned NOT NULL DEFAULT '128',
- `channel_w_chat` tinyint(3) unsigned NOT NULL DEFAULT '128',
- `channel_a_delegate` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `channel_r_stream` int(10) unsigned NOT NULL DEFAULT '128',
+ `channel_r_profile` int(10) unsigned NOT NULL DEFAULT '128',
+ `channel_r_photos` int(10) unsigned NOT NULL DEFAULT '128',
+ `channel_r_abook` int(10) unsigned NOT NULL DEFAULT '128',
+ `channel_w_stream` int(10) unsigned NOT NULL DEFAULT '128',
+ `channel_w_wall` int(10) unsigned NOT NULL DEFAULT '128',
+ `channel_w_tagwall` int(10) unsigned NOT NULL DEFAULT '128',
+ `channel_w_comment` int(10) unsigned NOT NULL DEFAULT '128',
+ `channel_w_mail` int(10) unsigned NOT NULL DEFAULT '128',
+ `channel_w_photos` int(10) unsigned NOT NULL DEFAULT '128',
+ `channel_w_chat` int(10) unsigned NOT NULL DEFAULT '128',
+ `channel_a_delegate` int(10) unsigned NOT NULL DEFAULT '0',
`channel_r_storage` int(10) unsigned NOT NULL DEFAULT '128',
`channel_w_storage` int(10) unsigned NOT NULL DEFAULT '128',
`channel_r_pages` int(10) unsigned NOT NULL DEFAULT '128',
`channel_w_pages` int(10) unsigned NOT NULL DEFAULT '128',
+ `channel_a_republish` int(10) unsigned NOT NULL DEFAULT '128',
+ `channel_a_bookmark` int(10) unsigned NOT NULL DEFAULT '128',
PRIMARY KEY (`channel_id`),
+ UNIQUE KEY `channel_address_unique` (`channel_address`),
KEY `channel_account_id` (`channel_account_id`),
KEY `channel_primary` (`channel_primary`),
KEY `channel_name` (`channel_name`),
- KEY `channel_address` (`channel_address`),
KEY `channel_timezone` (`channel_timezone`),
KEY `channel_location` (`channel_location`),
KEY `channel_theme` (`channel_theme`),
@@ -191,7 +217,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_gid` (`channel_default_gid`),
+ 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`),
@@ -211,9 +237,59 @@ CREATE TABLE IF NOT EXISTS `channel` (
KEY `channel_w_storage` (`channel_w_storage`),
KEY `channel_r_pages` (`channel_r_pages`),
KEY `channel_w_pages` (`channel_w_pages`),
- KEY `channel_deleted` (`channel_deleted`)
+ KEY `channel_deleted` (`channel_deleted`),
+ KEY `channel_a_republish` (`channel_a_republish`),
+ KEY `channel_a_bookmark` (`channel_a_bookmark`),
+ KEY `channel_dirdate` (`channel_dirdate`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+CREATE TABLE IF NOT EXISTS `chat` (
+ `chat_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+ `chat_room` int(10) unsigned NOT NULL DEFAULT '0',
+ `chat_xchan` char(255) NOT NULL DEFAULT '',
+ `chat_text` mediumtext NOT NULL,
+ `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
+ PRIMARY KEY (`chat_id`),
+ KEY `chat_room` (`chat_room`),
+ KEY `chat_xchan` (`chat_xchan`),
+ KEY `created` (`created`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+CREATE TABLE IF NOT EXISTS `chatpresence` (
+ `cp_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+ `cp_room` int(10) unsigned NOT NULL DEFAULT '0',
+ `cp_xchan` char(255) NOT NULL DEFAULT '',
+ `cp_last` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
+ `cp_status` char(255) NOT NULL,
+ `cp_client` char(128) NOT NULL DEFAULT '',
+ PRIMARY KEY (`cp_id`),
+ KEY `cp_room` (`cp_room`),
+ KEY `cp_xchan` (`cp_xchan`),
+ KEY `cp_last` (`cp_last`),
+ KEY `cp_status` (`cp_status`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+CREATE TABLE IF NOT EXISTS `chatroom` (
+ `cr_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+ `cr_aid` int(10) unsigned NOT NULL DEFAULT '0',
+ `cr_uid` int(10) unsigned NOT NULL DEFAULT '0',
+ `cr_name` char(255) NOT NULL DEFAULT '',
+ `cr_created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
+ `cr_edited` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
+ `cr_expire` int(10) unsigned NOT NULL DEFAULT '0',
+ `allow_cid` mediumtext NOT NULL,
+ `allow_gid` mediumtext NOT NULL,
+ `deny_cid` mediumtext NOT NULL,
+ `deny_gid` mediumtext NOT NULL,
+ PRIMARY KEY (`cr_id`),
+ KEY `cr_aid` (`cr_aid`),
+ KEY `cr_uid` (`cr_uid`),
+ KEY `cr_name` (`cr_name`),
+ KEY `cr_created` (`cr_created`),
+ KEY `cr_edited` (`cr_edited`),
+ KEY `cr_expire` (`cr_expire`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
CREATE TABLE IF NOT EXISTS `clients` (
`client_id` varchar(20) NOT NULL,
`pw` varchar(20) NOT NULL,
@@ -244,7 +320,7 @@ CREATE TABLE IF NOT EXISTS `event` (
`start` datetime NOT NULL,
`finish` datetime NOT NULL,
`summary` text NOT NULL,
- `desc` text NOT NULL,
+ `description` text NOT NULL,
`location` text NOT NULL,
`type` char(255) NOT NULL,
`nofinish` tinyint(1) NOT NULL DEFAULT '0',
@@ -265,7 +341,7 @@ CREATE TABLE IF NOT EXISTS `event` (
KEY `aid` (`aid`),
KEY `event_hash` (`event_hash`),
KEY `event_xchan` (`event_xchan`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `fcontact` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
@@ -307,7 +383,6 @@ CREATE TABLE IF NOT EXISTS `fserver` (
`key` text NOT NULL,
PRIMARY KEY (`id`),
KEY `server` (`server`),
- KEY `server_2` (`server`),
KEY `posturl` (`posturl`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
@@ -324,44 +399,7 @@ CREATE TABLE IF NOT EXISTS `fsuggest` (
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-CREATE TABLE IF NOT EXISTS `gcign` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `uid` int(11) NOT NULL,
- `gcid` int(11) NOT NULL,
- PRIMARY KEY (`id`),
- KEY `uid` (`uid`),
- KEY `gcid` (`gcid`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
-CREATE TABLE IF NOT EXISTS `gcontact` (
- `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
- `name` char(255) NOT NULL,
- `url` char(255) NOT NULL,
- `nurl` char(255) NOT NULL,
- `photo` char(255) NOT NULL,
- `connect` char(255) NOT NULL,
- PRIMARY KEY (`id`),
- KEY `nurl` (`nurl`),
- KEY `name` (`name`),
- KEY `url` (`url`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
-CREATE TABLE IF NOT EXISTS `glink` (
- `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
- `cid` int(11) NOT NULL,
- `uid` int(11) NOT NULL,
- `gcid` int(11) NOT NULL,
- `zcid` int(11) NOT NULL,
- `updated` datetime NOT NULL,
- PRIMARY KEY (`id`),
- KEY `cid` (`cid`),
- KEY `uid` (`uid`),
- KEY `gcid` (`gcid`),
- KEY `zcid` (`zcid`),
- KEY `updated` (`updated`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
-CREATE TABLE IF NOT EXISTS `group` (
+CREATE TABLE IF NOT EXISTS `groups` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`hash` char(255) NOT NULL DEFAULT '',
`uid` int(10) unsigned NOT NULL,
@@ -403,41 +441,25 @@ CREATE TABLE IF NOT EXISTS `hubloc` (
`hubloc_hash` char(255) NOT NULL,
`hubloc_addr` char(255) NOT NULL DEFAULT '',
`hubloc_flags` int(10) unsigned NOT NULL DEFAULT '0',
+ `hubloc_status` int(10) unsigned NOT NULL DEFAULT '0',
`hubloc_url` char(255) NOT NULL DEFAULT '',
`hubloc_url_sig` text NOT NULL,
`hubloc_host` char(255) NOT NULL DEFAULT '',
`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`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
-CREATE TABLE IF NOT EXISTS `intro` (
- `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
- `uid` int(10) unsigned NOT NULL,
- `fid` int(11) NOT NULL DEFAULT '0',
- `contact-id` int(11) NOT NULL,
- `knowyou` tinyint(1) NOT NULL,
- `duplex` tinyint(1) NOT NULL DEFAULT '0',
- `note` text NOT NULL,
- `hash` char(255) NOT NULL,
- `datetime` datetime NOT NULL,
- `blocked` tinyint(1) NOT NULL DEFAULT '1',
- `ignore` tinyint(1) NOT NULL DEFAULT '0',
- PRIMARY KEY (`id`),
- KEY `uid` (`uid`),
- KEY `fid` (`fid`),
- KEY `hash` (`hash`),
- KEY `datetime` (`datetime`),
- KEY `blocked` (`blocked`),
- KEY `ignore` (`ignore`),
- KEY `contact-id` (`contact-id`)
+ KEY `hubloc_addr` (`hubloc_addr`),
+ KEY `hubloc_updated` (`hubloc_updated`),
+ KEY `hubloc_connected` (`hubloc_connected`),
+ KEY `hubloc_status` (`hubloc_status`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `issue` (
@@ -459,12 +481,11 @@ CREATE TABLE IF NOT EXISTS `issue` (
CREATE TABLE IF NOT EXISTS `item` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
- `uri` char(255) CHARACTER SET ascii NOT NULL DEFAULT '',
+ `mid` char(255) CHARACTER SET ascii NOT NULL DEFAULT '',
`aid` int(10) unsigned NOT NULL DEFAULT '0',
`uid` int(10) unsigned NOT NULL DEFAULT '0',
- `wall` tinyint(1) NOT NULL DEFAULT '0',
`parent` int(10) unsigned NOT NULL DEFAULT '0',
- `parent_uri` char(255) CHARACTER SET ascii NOT NULL DEFAULT '',
+ `parent_mid` char(255) CHARACTER SET ascii NOT NULL DEFAULT '',
`thr_parent` char(255) NOT NULL DEFAULT '',
`created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`edited` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
@@ -474,51 +495,51 @@ CREATE TABLE IF NOT EXISTS `item` (
`changed` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`owner_xchan` char(255) NOT NULL DEFAULT '',
`author_xchan` char(255) NOT NULL DEFAULT '',
+ `source_xchan` char(255) NOT NULL DEFAULT '',
`mimetype` char(255) NOT NULL DEFAULT '',
- `title` char(255) NOT NULL DEFAULT '',
- `body` mediumtext NOT NULL,
+ `title` text NOT NULL DEFAULT '',
+ `body` mediumtext NOT NULL DEFAULT '',
`app` char(255) NOT NULL DEFAULT '',
`lang` char(64) NOT NULL DEFAULT '',
`revision` int(10) unsigned NOT NULL DEFAULT '0',
`verb` char(255) NOT NULL DEFAULT '',
`obj_type` char(255) NOT NULL DEFAULT '',
- `object` text NOT NULL,
+ `object` text NOT NULL DEFAULT '',
`tgt_type` char(255) NOT NULL DEFAULT '',
- `target` text NOT NULL,
- `postopts` text NOT NULL,
+ `target` text NOT NULL DEFAULT '',
+ `layout_mid` char(255) NOT NULL DEFAULT '',
+ `postopts` text NOT NULL DEFAULT '',
+ `route` text NOT NULL DEFAULT '',
`llink` char(255) NOT NULL DEFAULT '',
`plink` char(255) NOT NULL DEFAULT '',
`resource_id` char(255) NOT NULL DEFAULT '',
`resource_type` char(16) NOT NULL DEFAULT '',
- `attach` mediumtext NOT NULL,
- `inform` mediumtext NOT NULL,
+ `attach` mediumtext NOT NULL DEFAULT '',
+ `sig` text NOT NULL DEFAULT '',
`location` char(255) NOT NULL DEFAULT '',
`coord` char(255) NOT NULL DEFAULT '',
- `allow_cid` mediumtext NOT NULL,
- `allow_gid` mediumtext NOT NULL,
- `deny_cid` mediumtext NOT NULL,
- `deny_gid` mediumtext NOT NULL,
+ `comment_policy` char(255) NOT NULL DEFAULT '',
+ `allow_cid` mediumtext NOT NULL DEFAULT '',
+ `allow_gid` mediumtext NOT NULL DEFAULT '',
+ `deny_cid` mediumtext NOT NULL DEFAULT '',
+ `deny_gid` mediumtext NOT NULL DEFAULT '',
`item_restrict` int(11) NOT NULL DEFAULT '0',
`item_flags` int(11) NOT NULL DEFAULT '0',
`item_private` tinyint(4) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
- KEY `uri` (`uri`),
KEY `uid` (`uid`),
KEY `parent` (`parent`),
KEY `created` (`created`),
KEY `edited` (`edited`),
KEY `received` (`received`),
- KEY `wall` (`wall`),
KEY `uid_commented` (`uid`,`commented`),
KEY `uid_created` (`uid`,`created`),
- KEY `parent_uri` (`parent_uri`),
KEY `aid` (`aid`),
KEY `owner_xchan` (`owner_xchan`),
KEY `author_xchan` (`author_xchan`),
KEY `resource_type` (`resource_type`),
KEY `item_restrict` (`item_restrict`),
KEY `item_flags` (`item_flags`),
- KEY `uid_uri` (`uri`,`uid`),
KEY `commented` (`commented`),
KEY `verb` (`verb`),
KEY `item_private` (`item_private`),
@@ -526,6 +547,11 @@ CREATE TABLE IF NOT EXISTS `item` (
KEY `expires` (`expires`),
KEY `revision` (`revision`),
KEY `mimetype` (`mimetype`),
+ KEY `mid` (`mid`),
+ KEY `parent_mid` (`parent_mid`),
+ KEY `uid_mid` (`mid`,`uid`),
+ KEY `comment_policy` (`comment_policy`),
+ KEY `layout_mid` (`layout_mid`),
FULLTEXT KEY `title` (`title`),
FULLTEXT KEY `body` (`body`),
FULLTEXT KEY `allow_cid` (`allow_cid`),
@@ -554,43 +580,51 @@ CREATE TABLE IF NOT EXISTS `mail` (
`to_xchan` char(255) NOT NULL DEFAULT '',
`account_id` int(10) unsigned NOT NULL DEFAULT '0',
`channel_id` int(10) unsigned NOT NULL,
- `title` char(255) NOT NULL,
+ `title` text NOT NULL,
`body` mediumtext NOT NULL,
- `uri` char(255) NOT NULL,
- `parent_uri` char(255) NOT NULL,
+ `attach` mediumtext NOT NULL,
+ `mid` char(255) NOT NULL,
+ `parent_mid` char(255) NOT NULL,
`created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
+ `expires` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`id`),
- KEY `uri` (`uri`),
KEY `created` (`created`),
KEY `mail_flags` (`mail_flags`),
KEY `account_id` (`account_id`),
KEY `channel_id` (`channel_id`),
- KEY `parent_uri` (`parent_uri`),
KEY `from_xchan` (`from_xchan`),
- KEY `to_xchan` (`to_xchan`)
+ KEY `to_xchan` (`to_xchan`),
+ KEY `mid` (`mid`),
+ KEY `parent_mid` (`parent_mid`),
+ KEY `expires` (`expires`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `manage` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`uid` int(11) NOT NULL,
- `mid` int(11) NOT NULL,
+ `xchan` char(255) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
KEY `uid` (`uid`),
- KEY `mid` (`mid`)
+ KEY `xchan` (`xchan`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `menu` (
`menu_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`menu_channel_id` int(10) unsigned NOT NULL DEFAULT '0',
+ `menu_name` char(255) NOT NULL DEFAULT '',
`menu_desc` char(255) NOT NULL DEFAULT '',
+ `menu_flags` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`menu_id`),
- KEY `menu_channel_id` (`menu_channel_id`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+ KEY `menu_channel_id` (`menu_channel_id`),
+ KEY `menu_name` (`menu_name`),
+ KEY `menu_flags` (`menu_flags`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `menu_item` (
`mitem_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`mitem_link` char(255) NOT NULL DEFAULT '',
`mitem_desc` char(255) NOT NULL DEFAULT '',
+ `mitem_flags` int(11) NOT NULL DEFAULT '0',
`allow_cid` mediumtext NOT NULL,
`allow_gid` mediumtext NOT NULL,
`deny_cid` mediumtext NOT NULL,
@@ -600,8 +634,9 @@ CREATE TABLE IF NOT EXISTS `menu_item` (
`mitem_order` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`mitem_id`),
KEY `mitem_channel_id` (`mitem_channel_id`),
- KEY `mitem_menu_id` (`mitem_menu_id`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+ KEY `mitem_menu_id` (`mitem_menu_id`),
+ KEY `mitem_flags` (`mitem_flags`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `notify` (
`id` int(11) NOT NULL AUTO_INCREMENT,
@@ -611,9 +646,10 @@ CREATE TABLE IF NOT EXISTS `notify` (
`photo` char(255) NOT NULL,
`date` datetime NOT NULL,
`msg` mediumtext NOT NULL,
+ `aid` int(11) NOT NULL,
`uid` int(11) NOT NULL,
`link` char(255) NOT NULL,
- `parent` int(11) NOT NULL,
+ `parent` char(255) NOT NULL DEFAULT '',
`seen` tinyint(1) NOT NULL DEFAULT '0',
`type` int(11) NOT NULL,
`verb` char(255) NOT NULL,
@@ -626,13 +662,34 @@ CREATE TABLE IF NOT EXISTS `notify` (
KEY `hash` (`hash`),
KEY `parent` (`parent`),
KEY `link` (`link`),
- KEY `otype` (`otype`)
+ KEY `otype` (`otype`),
+ KEY `aid` (`aid`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+CREATE TABLE IF NOT EXISTS `obj` (
+ `obj_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+ `obj_page` char(64) NOT NULL DEFAULT '',
+ `obj_verb` char(255) NOT NULL DEFAULT '',
+ `obj_type` int(10) unsigned NOT NULL DEFAULT '0',
+ `obj_obj` char(255) NOT NULL DEFAULT '',
+ `obj_channel` int(10) unsigned NOT NULL DEFAULT '0',
+ `allow_cid` mediumtext NOT NULL,
+ `allow_gid` mediumtext NOT NULL,
+ `deny_cid` mediumtext NOT NULL,
+ `deny_gid` mediumtext NOT NULL,
+ PRIMARY KEY (`obj_id`),
+ KEY `obj_verb` (`obj_verb`),
+ KEY `obj_page` (`obj_page`),
+ KEY `obj_type` (`obj_type`),
+ KEY `obj_channel` (`obj_channel`),
+ KEY `obj_obj` (`obj_obj`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `outq` (
`outq_hash` char(255) NOT NULL,
`outq_account` int(10) unsigned NOT NULL DEFAULT '0',
`outq_channel` int(10) unsigned NOT NULL DEFAULT '0',
+ `outq_driver` char(32) NOT NULL DEFAULT '',
`outq_posturl` char(255) NOT NULL DEFAULT '',
`outq_async` tinyint(1) NOT NULL DEFAULT '0',
`outq_delivered` tinyint(1) NOT NULL DEFAULT '0',
@@ -669,7 +726,7 @@ CREATE TABLE IF NOT EXISTS `photo` (
`created` datetime NOT NULL,
`edited` datetime NOT NULL,
`title` char(255) NOT NULL,
- `desc` text NOT NULL,
+ `description` text NOT NULL,
`album` char(255) NOT NULL,
`filename` char(255) NOT NULL,
`type` char(128) NOT NULL DEFAULT 'image/jpeg',
@@ -679,6 +736,7 @@ CREATE TABLE IF NOT EXISTS `photo` (
`data` mediumblob NOT NULL,
`scale` tinyint(3) NOT NULL,
`profile` tinyint(1) NOT NULL DEFAULT '0',
+ `photo_flags` int(10) unsigned NOT NULL DEFAULT '0',
`allow_cid` mediumtext NOT NULL,
`allow_gid` mediumtext NOT NULL,
`deny_cid` mediumtext NOT NULL,
@@ -688,6 +746,7 @@ CREATE TABLE IF NOT EXISTS `photo` (
KEY `album` (`album`),
KEY `scale` (`scale`),
KEY `profile` (`profile`),
+ KEY `photo_flags` (`photo_flags`),
KEY `type` (`type`),
KEY `aid` (`aid`),
KEY `xchan` (`xchan`),
@@ -695,6 +754,29 @@ CREATE TABLE IF NOT EXISTS `photo` (
KEY `resource_id` (`resource_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+CREATE TABLE IF NOT EXISTS `poll` (
+ `poll_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+ `poll_channel` int(10) unsigned NOT NULL DEFAULT '0',
+ `poll_desc` text NOT NULL,
+ `poll_flags` int(11) NOT NULL DEFAULT '0',
+ `poll_votes` int(11) NOT NULL DEFAULT '0',
+ PRIMARY KEY (`poll_id`),
+ KEY `poll_channel` (`poll_channel`),
+ KEY `poll_flags` (`poll_flags`),
+ KEY `poll_votes` (`poll_votes`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+CREATE TABLE IF NOT EXISTS `poll_elm` (
+ `pelm_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+ `pelm_poll` int(10) unsigned NOT NULL DEFAULT '0',
+ `pelm_desc` text NOT NULL,
+ `pelm_flags` int(11) NOT NULL DEFAULT '0',
+ `pelm_result` float NOT NULL DEFAULT '0',
+ PRIMARY KEY (`pelm_id`),
+ KEY `pelm_poll` (`pelm_poll`),
+ KEY `pelm_result` (`pelm_result`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
CREATE TABLE IF NOT EXISTS `profile` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`profile_guid` char(64) NOT NULL DEFAULT '',
@@ -705,6 +787,7 @@ CREATE TABLE IF NOT EXISTS `profile` (
`hide_friends` tinyint(1) NOT NULL DEFAULT '0',
`name` char(255) NOT NULL,
`pdesc` char(255) NOT NULL,
+ `chandesc` text NOT NULL,
`dob` char(32) NOT NULL DEFAULT '0000-00-00',
`dob_tz` char(255) NOT NULL DEFAULT 'UTC',
`address` char(255) NOT NULL,
@@ -734,6 +817,7 @@ CREATE TABLE IF NOT EXISTS `profile` (
`work` text NOT NULL,
`education` text NOT NULL,
`contact` text NOT NULL,
+ `channels` text NOT NULL,
`homepage` char(255) NOT NULL,
`photo` char(255) NOT NULL,
`thumb` char(255) NOT NULL,
@@ -770,22 +854,6 @@ CREATE TABLE IF NOT EXISTS `profile_check` (
KEY `expire` (`expire`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-CREATE TABLE IF NOT EXISTS `queue` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `cid` int(11) NOT NULL,
- `network` char(32) NOT NULL,
- `created` datetime NOT NULL,
- `last` datetime NOT NULL,
- `content` mediumtext NOT NULL,
- `batch` tinyint(1) NOT NULL DEFAULT '0',
- PRIMARY KEY (`id`),
- KEY `cid` (`cid`),
- KEY `network` (`network`),
- KEY `created` (`created`),
- KEY `last` (`last`),
- KEY `batch` (`batch`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
CREATE TABLE IF NOT EXISTS `register` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`hash` char(255) NOT NULL,
@@ -797,29 +865,61 @@ CREATE TABLE IF NOT EXISTS `register` (
KEY `hash` (`hash`),
KEY `created` (`created`),
KEY `uid` (`uid`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `session` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`sid` char(255) NOT NULL,
`data` text NOT NULL,
- `expire` int(10) unsigned NOT NULL,
+ `expire` bigint(20) unsigned NOT NULL,
PRIMARY KEY (`id`),
KEY `sid` (`sid`),
KEY `expire` (`expire`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+CREATE TABLE IF NOT EXISTS `shares` (
+ `share_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+ `share_type` int(11) NOT NULL DEFAULT '0',
+ `share_target` int(10) unsigned NOT NULL DEFAULT '0',
+ `share_xchan` char(255) NOT NULL DEFAULT '',
+ PRIMARY KEY (`share_id`),
+ KEY `share_type` (`share_type`),
+ KEY `share_target` (`share_target`),
+ KEY `share_xchan` (`share_xchan`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
CREATE TABLE IF NOT EXISTS `site` (
`site_url` char(255) NOT NULL,
+ `site_access` int(11) NOT NULL DEFAULT '0',
`site_flags` int(11) NOT NULL DEFAULT '0',
`site_update` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
+ `site_pull` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
+ `site_sync` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`site_directory` char(255) NOT NULL DEFAULT '',
+ `site_register` int(11) NOT NULL DEFAULT '0',
+ `site_sellpage` char(255) NOT NULL DEFAULT '',
+ `site_location` char(255) NOT NULL DEFAULT '',
PRIMARY KEY (`site_url`),
KEY `site_flags` (`site_flags`),
KEY `site_update` (`site_update`),
- KEY `site_directory` (`site_directory`)
+ KEY `site_directory` (`site_directory`),
+ KEY `site_register` (`site_register`),
+ KEY `site_access` (`site_access`),
+ KEY `site_sellpage` (`site_sellpage`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+CREATE TABLE IF NOT EXISTS `source` (
+ `src_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+ `src_channel_id` int(10) unsigned NOT NULL DEFAULT '0',
+ `src_channel_xchan` char(255) NOT NULL DEFAULT '',
+ `src_xchan` char(255) NOT NULL DEFAULT '',
+ `src_patt` mediumtext NOT NULL,
+ PRIMARY KEY (`src_id`),
+ KEY `src_channel_id` (`src_channel_id`),
+ KEY `src_channel_xchan` (`src_channel_xchan`),
+ KEY `src_xchan` (`src_xchan`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
CREATE TABLE IF NOT EXISTS `spam` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`uid` int(11) NOT NULL,
@@ -834,6 +934,15 @@ CREATE TABLE IF NOT EXISTS `spam` (
KEY `term` (`term`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+CREATE TABLE IF NOT EXISTS `sys_perms` (
+ `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+ `cat` char(255) NOT NULL,
+ `k` char(255) NOT NULL,
+ `v` mediumtext NOT NULL,
+ `public_perm` tinyint(1) unsigned NOT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
CREATE TABLE IF NOT EXISTS `term` (
`tid` int(10) unsigned NOT NULL AUTO_INCREMENT,
`aid` int(10) unsigned NOT NULL DEFAULT '0',
@@ -843,20 +952,26 @@ CREATE TABLE IF NOT EXISTS `term` (
`type` tinyint(3) unsigned NOT NULL,
`term` char(255) NOT NULL,
`url` char(255) NOT NULL,
+ `imgurl` char(255) NOT NULL,
+ `term_hash` char(255) NOT NULL DEFAULT '',
+ `parent_hash` char(255) NOT NULL DEFAULT '',
PRIMARY KEY (`tid`),
KEY `oid` (`oid`),
KEY `otype` (`otype`),
KEY `type` (`type`),
KEY `term` (`term`),
KEY `uid` (`uid`),
- KEY `aid` (`aid`)
+ KEY `aid` (`aid`),
+ KEY `imgurl` (`imgurl`),
+ KEY `term_hash` (`term_hash`),
+ KEY `parent_hash` (`parent_hash`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `tokens` (
`id` varchar(40) NOT NULL,
`secret` text NOT NULL,
`client_id` varchar(20) NOT NULL,
- `expires` int(11) NOT NULL,
+ `expires` bigint(20) unsigned NOT NULL,
`scope` varchar(200) NOT NULL,
`uid` int(11) NOT NULL,
PRIMARY KEY (`id`),
@@ -865,6 +980,23 @@ CREATE TABLE IF NOT EXISTS `tokens` (
KEY `uid` (`uid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+CREATE TABLE IF NOT EXISTS `updates` (
+ `ud_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+ `ud_hash` char(128) NOT NULL,
+ `ud_guid` char(255) NOT NULL DEFAULT '',
+ `ud_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
+ `ud_last` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
+ `ud_flags` int(11) NOT NULL DEFAULT '0',
+ `ud_addr` char(255) NOT NULL DEFAULT '',
+ PRIMARY KEY (`ud_id`),
+ KEY `ud_date` (`ud_date`),
+ KEY `ud_guid` (`ud_guid`),
+ KEY `ud_hash` (`ud_hash`),
+ KEY `ud_flags` (`ud_flags`),
+ KEY `ud_addr` (`ud_addr`),
+ KEY `ud_last` (`ud_last`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
CREATE TABLE IF NOT EXISTS `verify` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`channel` int(10) unsigned NOT NULL DEFAULT '0',
@@ -880,6 +1012,18 @@ CREATE TABLE IF NOT EXISTS `verify` (
KEY `created` (`created`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+CREATE TABLE IF NOT EXISTS `vote` (
+ `vote_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+ `vote_poll` int(11) NOT NULL DEFAULT '0',
+ `vote_element` int(11) NOT NULL DEFAULT '0',
+ `vote_result` text NOT NULL,
+ `vote_xchan` char(255) NOT NULL DEFAULT '',
+ PRIMARY KEY (`vote_id`),
+ UNIQUE KEY `vote_vote` (`vote_poll`,`vote_element`,`vote_xchan`),
+ KEY `vote_poll` (`vote_poll`),
+ KEY `vote_element` (`vote_element`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
CREATE TABLE IF NOT EXISTS `xchan` (
`xchan_hash` char(255) NOT NULL,
`xchan_guid` char(255) NOT NULL DEFAULT '',
@@ -892,8 +1036,11 @@ CREATE TABLE IF NOT EXISTS `xchan` (
`xchan_addr` char(255) NOT NULL DEFAULT '',
`xchan_url` char(255) NOT NULL DEFAULT '',
`xchan_connurl` char(255) NOT NULL DEFAULT '',
+ `xchan_follow` char(255) NOT NULL DEFAULT '',
+ `xchan_connpage` char(255) NOT NULL DEFAULT '',
`xchan_name` char(255) NOT NULL DEFAULT '',
`xchan_network` char(255) NOT NULL DEFAULT '',
+ `xchan_instance_url` char(255) NOT NULL DEFAULT '',
`xchan_flags` int(10) unsigned NOT NULL DEFAULT '0',
`xchan_photo_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`xchan_name_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
@@ -904,7 +1051,43 @@ CREATE TABLE IF NOT EXISTS `xchan` (
KEY `xchan_network` (`xchan_network`),
KEY `xchan_url` (`xchan_url`),
KEY `xchan_flags` (`xchan_flags`),
- KEY `xchan_connurl` (`xchan_connurl`)
+ KEY `xchan_connurl` (`xchan_connurl`),
+ KEY `xchan_instance_url` (`xchan_instance_url`),
+ KEY `xchan_follow` (`xchan_follow`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+CREATE TABLE IF NOT EXISTS `xchat` (
+ `xchat_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+ `xchat_url` char(255) NOT NULL DEFAULT '',
+ `xchat_desc` char(255) NOT NULL DEFAULT '',
+ `xchat_xchan` char(255) NOT NULL DEFAULT '',
+ `xchat_edited` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
+ PRIMARY KEY (`xchat_id`),
+ KEY `xchat_url` (`xchat_url`),
+ KEY `xchat_desc` (`xchat_desc`),
+ KEY `xchat_xchan` (`xchat_xchan`),
+ KEY `xchat_edited` (`xchat_edited`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+CREATE TABLE IF NOT EXISTS `xconfig` (
+ `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+ `xchan` char(255) NOT NULL,
+ `cat` char(255) NOT NULL,
+ `k` char(255) NOT NULL,
+ `v` mediumtext NOT NULL,
+ PRIMARY KEY (`id`),
+ KEY `xchan` (`xchan`),
+ KEY `cat` (`cat`),
+ KEY `k` (`k`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+CREATE TABLE IF NOT EXISTS `xign` (
+ `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+ `uid` int(11) NOT NULL DEFAULT '0',
+ `xchan` char(255) NOT NULL DEFAULT '',
+ PRIMARY KEY (`id`),
+ KEY `uid` (`uid`),
+ KEY `xchan` (`xchan`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `xlink` (
@@ -918,10 +1101,11 @@ CREATE TABLE IF NOT EXISTS `xlink` (
KEY `xlink_link` (`xlink_link`),
KEY `xlink_updated` (`xlink_updated`),
KEY `xlink_rating` (`xlink_rating`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `xprof` (
`xprof_hash` char(255) NOT NULL,
+ `xprof_age` tinyint(3) unsigned NOT NULL DEFAULT '0',
`xprof_desc` char(255) NOT NULL DEFAULT '',
`xprof_dob` char(12) NOT NULL DEFAULT '',
`xprof_gender` char(255) NOT NULL DEFAULT '',
@@ -932,6 +1116,9 @@ CREATE TABLE IF NOT EXISTS `xprof` (
`xprof_postcode` char(32) NOT NULL DEFAULT '',
`xprof_country` char(255) NOT NULL DEFAULT '',
`xprof_keywords` text NOT NULL,
+ `xprof_about` text NOT NULL,
+ `xprof_homepage` char(255) NOT NULL DEFAULT '',
+ `xprof_hometown` char(255) NOT NULL DEFAULT '',
PRIMARY KEY (`xprof_hash`),
KEY `xprof_desc` (`xprof_desc`),
KEY `xprof_dob` (`xprof_dob`),
@@ -941,12 +1128,18 @@ CREATE TABLE IF NOT EXISTS `xprof` (
KEY `xprof_locale` (`xprof_locale`),
KEY `xprof_region` (`xprof_region`),
KEY `xprof_postcode` (`xprof_postcode`),
- KEY `xprof_country` (`xprof_country`)
+ KEY `xprof_country` (`xprof_country`),
+ KEY `xprof_age` (`xprof_age`),
+ KEY `xprof_hometown` (`xprof_hometown`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `xtag` (
+ `xtag_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`xtag_hash` char(255) NOT NULL,
`xtag_term` char(255) NOT NULL DEFAULT '',
- PRIMARY KEY (`xtag_hash`),
- KEY `xtag_term` (`xtag_term`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+ `xtag_flags` int(11) NOT NULL DEFAULT '0',
+ PRIMARY KEY (`xtag_id`),
+ KEY `xtag_term` (`xtag_term`),
+ KEY `xtag_hash` (`xtag_hash`),
+ KEY `xtag_flags` (`xtag_flags`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
diff --git a/install/htconfig.sample.php b/install/htconfig.sample.php
index ebfc84543..b23dfe3b6 100644..100755
--- a/install/htconfig.sample.php
+++ b/install/htconfig.sample.php
@@ -3,7 +3,7 @@
// If automatic system installation fails:
// Copy or rename this file to .htconfig.php in the top level
-// Friendica directory
+// Red Matrix directory
// Why .htconfig.php? Because it contains sensitive information which could
// give somebody complete control of your database. Apache's default
@@ -12,11 +12,26 @@
// Then set the following for your MySQL installation
-$db_host = 'your.mysqlhost.com';
+$db_host = 'your.mysqlhost.com'; // Use 'localhost' if you aren't using a remote server
+$db_port = 0; // leave 0 for default or set your port
$db_user = 'mysqlusername';
$db_pass = 'mysqlpassword';
$db_data = 'mysqldatabasename';
+
+/*
+ * Notice: Many of the following settings will be available in the admin panel
+ * after a successful site install. Once they are set in the admin panel, they
+ * are stored in the DB - and the DB setting will over-ride any corresponding
+ * setting in this file
+ *
+ * The command-line tool util/config is able to query and set the DB items
+ * directly if for some reason the admin panel is not available and a system
+ * setting requires modification.
+ *
+ */
+
+
// Choose a legal default timezone. If you are unsure, use "America/Los_Angeles".
// It can be changed later and only applies to timestamps for anonymous viewers.
@@ -24,7 +39,10 @@ $default_timezone = 'America/Los_Angeles';
// What is your site name?
-$a->config['sitename'] = "Friendica Social Network";
+$a->config['system']['baseurl'] = 'https://myredsite.example';
+$a->config['system']['sitename'] = "Red Matrix";
+$a->config['system']['location_hash'] = 'if the auto install failed, put a unique random string here';
+
// Your choices are REGISTER_OPEN, REGISTER_APPROVE, or REGISTER_CLOSED.
// Be certain to create your own personal account before setting
@@ -37,20 +55,12 @@ $a->config['sitename'] = "Friendica Social Network";
// must precisely match the email address of the person logged in.
$a->config['system']['register_policy'] = REGISTER_OPEN;
-$a->config['register_text'] = '';
+$a->config['system']['register_text'] = '';
$a->config['system']['admin_email'] = '';
-// Maximum size of an imported message, 0 is unlimited
-
-$a->config['max_import_size'] = 200000;
-
-// maximum size of uploaded photos
-
-$a->config['system']['maximagesize'] = 800000;
-
// Location of PHP command line processor
-$a->config['php_path'] = 'php';
+$a->config['system']['php_path'] = 'php';
// Configure how we communicate with directory servers.
@@ -62,17 +72,13 @@ $a->config['php_path'] = 'php';
$a->config['system']['directory_mode'] = DIRECTORY_MODE_NORMAL;
-// PuSH - aka pubsubhubbub URL. This makes delivery of public posts as fast as private posts
-
-$a->config['system']['huburl'] = 'http://pubsubhubbub.appspot.com';
-
-// allowed themes (change this from admin panel after installation)
-
-$a->config['system']['allowed_themes'] = 'redbasic';
-
-// default system theme
-
-$a->config['system']['theme'] = 'redbasic';
-
-
+// PHP error logging setup
+// Before doing this ensure that the webserver has permission
+// to create and write to php.out in the top level Red directory,
+// or change the name (below) to a file/path where this is allowed.
+// Uncomment the following 4 lines to turn on PHP error logging.
+//error_reporting(E_ERROR | E_WARNING | E_PARSE );
+//ini_set('error_log','php.out');
+//ini_set('log_errors','1');
+//ini_set('display_errors', '0');
diff --git a/install/update.php b/install/update.php
index c40dd1982..0d5d26237 100644
--- a/install/update.php
+++ b/install/update.php
@@ -1,6 +1,6 @@
<?php
-define( 'UPDATE_VERSION' , 1031 );
+define( 'UPDATE_VERSION' , 1112 );
/**
*
@@ -52,7 +52,7 @@ function update_r1001() {
`meta` CHAR( 255 ) NOT NULL DEFAULT '',
`created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY ( `id` )
- ) ENGINE = MYISAM ");
+ ) ENGINE = MYISAM DEFAULT CHARSET=utf8");
$r2 = q("alter table `verify` add index (`channel`), add index (`type`), add index (`token`),
add index (`meta`), add index (`created`)");
@@ -91,7 +91,7 @@ function update_r1004() {
`site_update` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
`site_directory` CHAR( 255 ) NOT NULL DEFAULT '',
PRIMARY KEY ( `site_url` )
-) ENGINE = MYISAM ");
+) ENGINE = MYISAM DEFAULT CHARSET=utf8");
$r2 = q("alter table site add index (site_flags), add index (site_update), add index (site_directory) ");
@@ -204,7 +204,7 @@ function update_r1013() {
`xlink_xchan` CHAR( 255 ) NOT NULL DEFAULT '',
`xlink_link` CHAR( 255 ) NOT NULL DEFAULT '',
`xlink_updated` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00'
-) ENGINE = MYISAM ");
+) ENGINE = MYISAM DEFAULT CHARSET=utf8");
$r2 = q("alter table xlink add index ( xlink_xchan ), add index ( xlink_link ), add index ( xlink_updated ) ");
if($r && $r2)
@@ -367,7 +367,7 @@ ADD INDEX ( `channel_deleted` ) ");
}
function update_r1030() {
- $r = q("CREATE TABLE IF NOT EXISTS`issue` (
+ $r = q("CREATE TABLE IF NOT EXISTS `issue` (
`issue_id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`issue_created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
`issue_updated` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
@@ -381,9 +381,873 @@ KEY `issue_assigned` (`issue_assigned`),
KEY `issue_priority` (`issue_priority`),
KEY `issue_status` (`issue_status`),
KEY `issue_component` (`issue_component`)
-) ENGINE = MYISAM ");
+) ENGINE = MYISAM DEFAULT CHARSET=utf8");
if($r)
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}
+
+function update_r1031() {
+ $r = q("ALTER TABLE `account` ADD `account_external` CHAR( 255 ) NOT NULL DEFAULT '' AFTER `account_email` ,
+ADD INDEX ( `account_external` )");
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+
+function update_r1032() {
+ $r = q("CREATE TABLE if not exists `xign` (
+`id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
+`uid` INT NOT NULL DEFAULT '0',
+`xchan` CHAR( 255 ) NOT NULL DEFAULT '',
+KEY `uid` (`uid`),
+KEY `xchan` (`xchan`)
+) ENGINE = MYISAM DEFAULT CHARSET = utf8");
+
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+function update_r1033() {
+ $r = q("CREATE TABLE if not exists `shares` (
+`share_id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
+`share_type` INT NOT NULL DEFAULT '0',
+`share_target` INT UNSIGNED NOT NULL DEFAULT '0',
+`share_xchan` CHAR( 255 ) NOT NULL DEFAULT '',
+KEY `share_type` (`share_type`),
+KEY `share_target` (`share_target`),
+KEY `share_xchan` (`share_xchan`)
+) ENGINE = MYISAM DEFAULT CHARSET = utf8");
+
+ // if these fail don't bother reporting it
+
+ q("drop table gcign");
+ q("drop table gcontact");
+ q("drop table glink");
+
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+function update_r1034() {
+ $r = q("CREATE TABLE if not exists `updates` (
+`ud_hash` CHAR( 128 ) NOT NULL ,
+`ud_date` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
+PRIMARY KEY ( `ud_hash` ),
+KEY `ud_date` ( `ud_date` )
+) ENGINE = MYISAM DEFAULT CHARSET = utf8");
+
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+function update_r1035() {
+ $r = q("CREATE TABLE if not exists `xconfig` (
+`id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
+`xchan` CHAR( 255 ) NOT NULL ,
+`cat` CHAR( 255 ) NOT NULL ,
+`k` CHAR( 255 ) NOT NULL ,
+`v` MEDIUMTEXT NOT NULL,
+KEY `xchan` ( `xchan` ),
+KEY `cat` ( `cat` ),
+KEY `k` ( `k` )
+) ENGINE = MYISAM DEFAULT CHARSET = utf8");
+
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+function update_r1036() {
+ $r = q("ALTER TABLE `profile` ADD `channels` TEXT NOT NULL AFTER `contact` ");
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+
+}
+
+
+function update_r1037() {
+ $r1 = q("ALTER TABLE `item` CHANGE `uri` `mid` CHAR( 255 ) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL DEFAULT '',
+CHANGE `parent_uri` `parent_mid` CHAR( 255 ) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL DEFAULT '',
+ DROP INDEX `uri` ,
+ADD INDEX `mid` ( `mid` ),
+DROP INDEX `parent_uri` ,
+ADD INDEX `parent_mid` ( `parent_mid` ),
+ DROP INDEX `uid_uri` ,
+ADD INDEX `uid_mid` ( `mid` , `uid` ) ");
+
+ $r2 = q("ALTER TABLE `mail` CHANGE `uri` `mid` CHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
+CHANGE `parent_uri` `parent_mid` CHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
+DROP INDEX `uri` ,
+ADD INDEX `mid` ( `mid` ),
+ DROP INDEX `parent_uri` ,
+ADD INDEX `parent_mid` ( `parent_mid` ) ");
+
+ if($r1 && $r2)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+
+function update_r1038() {
+ $r = q("ALTER TABLE `manage` CHANGE `mid` `xchan` CHAR( 255 ) NOT NULL DEFAULT '', drop index `mid`, ADD INDEX ( `xchan` )");
+
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+
+}
+
+
+function update_r1039() {
+ $r = q("ALTER TABLE `channel` CHANGE `channel_default_gid` `channel_default_group` CHAR( 255 ) NOT NULL DEFAULT ''");
+
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+
+}
+
+function update_r1040() {
+ $r1 = q("ALTER TABLE `session` CHANGE `expire` `expire` BIGINT UNSIGNED NOT NULL ");
+ $r2 = q("ALTER TABLE `tokens` CHANGE `expires` `expires` BIGINT UNSIGNED NOT NULL ");
+
+ if($r1 && $r2)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+function update_r1041() {
+ $r = q("ALTER TABLE `outq` ADD `outq_driver` CHAR( 32 ) NOT NULL DEFAULT '' AFTER `outq_channel` ");
+
+ if($r)
+ return UPDATE_SUCCESS;
+ 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;
+}
+
+
+function update_r1043() {
+ $r = q("ALTER TABLE `item` ADD `comment_policy` CHAR( 255 ) NOT NULL DEFAULT '' AFTER `coord` ,
+ADD INDEX ( `comment_policy` ) ");
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+function update_r1044() {
+ $r = q("ALTER TABLE `term` ADD `imgurl` CHAR( 255 ) NOT NULL ,
+ADD INDEX ( `imgurl` ) ");
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+function update_r1045() {
+ $r = q("ALTER TABLE `site` ADD `site_register` INT NOT NULL DEFAULT '0',
+ADD INDEX ( `site_register` ) ");
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+function update_r1046() {
+ $r = q("ALTER TABLE `term` ADD `term_hash` CHAR( 255 ) NOT NULL DEFAULT '',
+ADD INDEX ( `term_hash` ) ");
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+function update_r1047() {
+ $r = q("ALTER TABLE `xprof` ADD `xprof_age` TINYINT( 3 ) UNSIGNED NOT NULL DEFAULT '0' AFTER `xprof_hash` ,
+ADD INDEX ( `xprof_age` ) ");
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+function update_r1048() {
+ $r = q("CREATE TABLE IF NOT EXISTS `obj` (
+ `obj_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+ `obj_page` char(64) NOT NULL DEFAULT '',
+ `obj_verb` char(255) NOT NULL DEFAULT '',
+ `obj_type` int(10) unsigned NOT NULL DEFAULT '0',
+ `obj_obj` char(255) NOT NULL DEFAULT '',
+ `obj_channel` int(10) unsigned NOT NULL DEFAULT '0',
+ PRIMARY KEY (`obj_id`),
+ KEY `obj_verb` (`obj_verb`),
+ KEY `obj_page` (`obj_page`),
+ KEY `obj_type` (`obj_type`),
+ KEY `obj_channel` (`obj_channel`),
+ KEY `obj_obj` (`obj_obj`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ");
+
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+
+function update_r1049() {
+ $r = q("ALTER TABLE `term` ADD `parent_hash` CHAR( 255 ) NOT NULL DEFAULT '' AFTER `term_hash` , ADD INDEX ( `parent_hash` ) ");
+
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+function update_r1050() {
+ $r = q("ALTER TABLE `xtag` DROP PRIMARY KEY , ADD `xtag_id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST , ADD INDEX ( `xtag_hash` ) ");
+
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+function update_r1051() {
+ $r = q("ALTER TABLE `photo` ADD `photo_flags` INT UNSIGNED NOT NULL DEFAULT '0' AFTER `profile` , ADD INDEX ( `photo_flags` ) ");
+
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+
+function update_r1052() {
+ $r = q("ALTER TABLE `channel` ADD UNIQUE (`channel_address`) ");
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+function update_r1053() {
+ $r = q("ALTER TABLE `profile` ADD `chandesc` TEXT NOT NULL DEFAULT '' AFTER `pdesc` ");
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+function update_r1054() {
+ $r = q("ALTER TABLE `item` CHANGE `title` `title` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' ");
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+function update_r1055() {
+ $r = q("ALTER TABLE `mail` CHANGE `title` `title` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' ");
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+function update_r1056() {
+ $r = q("ALTER TABLE `xchan` ADD `xchan_instance_url` CHAR( 255 ) NOT NULL DEFAULT '' AFTER `xchan_network` ,
+ADD INDEX ( `xchan_instance_url` ) ");
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+function update_r1057() {
+ $r = q("drop table intro");
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+function update_r1058() {
+ $r1 = q("ALTER TABLE `menu` ADD `menu_name` CHAR( 255 ) NOT NULL DEFAULT '' AFTER `menu_channel_id` ,
+ADD INDEX ( `menu_name` ) ");
+
+ $r2 = q("ALTER TABLE `menu_item` ADD `mitem_flags` INT NOT NULL DEFAULT '0' AFTER `mitem_desc` ,
+ADD INDEX ( `mitem_flags` ) ");
+
+ if($r1 && $r2)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+function update_r1059() {
+ $r = q("ALTER TABLE `mail` ADD `attach` MEDIUMTEXT NOT NULL DEFAULT '' AFTER `body` ");
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+function update_r1060() {
+
+ $r = q("CREATE TABLE IF NOT EXISTS `vote` (
+ `vote_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+ `vote_poll` int(11) NOT NULL DEFAULT '0',
+ `vote_element` int(11) NOT NULL DEFAULT '0',
+ `vote_result` text NOT NULL,
+ `vote_xchan` char(255) NOT NULL DEFAULT '',
+ PRIMARY KEY (`vote_id`),
+ UNIQUE KEY `vote_vote` (`vote_poll`,`vote_element`,`vote_xchan`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ");
+
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+function update_r1061() {
+ $r = q("ALTER TABLE `vote` ADD INDEX ( `vote_poll` ), ADD INDEX ( `vote_element` ) ");
+
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+function update_r1062() {
+ $r1 = q("CREATE TABLE IF NOT EXISTS `poll` (
+`poll_id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
+`poll_channel` INT UNSIGNED NOT NULL DEFAULT '0',
+`poll_desc` TEXT NOT NULL DEFAULT '',
+`poll_flags` INT NOT NULL DEFAULT '0',
+`poll_votes` INT NOT NULL DEFAULT '0',
+KEY `poll_channel` (`poll_channel`),
+KEY `poll_flags` (`poll_flags`),
+KEY `poll_votes` (`poll_votes`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ");
+
+ $r2 = q("CREATE TABLE IF NOT EXISTS `poll_elm` (
+`pelm_id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
+`pelm_poll` INT UNSIGNED NOT NULL DEFAULT '0',
+`pelm_desc` TEXT NOT NULL DEFAULT '',
+`pelm_flags` INT NOT NULL DEFAULT '0',
+`pelm_result` FLOAT NOT NULL DEFAULT '0',
+KEY `pelm_poll` (`pelm_poll`),
+KEY `pelm_result` (`pelm_result`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ");
+
+ if($r1 && $r2)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+function update_r1063() {
+ $r = q("ALTER TABLE `xchan` ADD `xchan_follow` CHAR( 255 ) NOT NULL DEFAULT '' AFTER `xchan_connurl` ,
+ADD `xchan_connpage` CHAR( 255 ) NOT NULL DEFAULT '' AFTER `xchan_follow` ,
+ADD INDEX ( `xchan_follow` ), ADD INDEX ( `xchan_connpage`) ");
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+function update_r1064() {
+ $r = q("ALTER TABLE `updates` ADD `ud_guid` CHAR( 255 ) NOT NULL DEFAULT '' AFTER `ud_hash` ,
+ADD INDEX ( `ud_guid` )");
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+function update_r1065() {
+ $r = q("ALTER TABLE `item` DROP `wall`, ADD `layout_mid` CHAR( 255 ) NOT NULL DEFAULT '' AFTER `target` ,
+ADD INDEX ( `layout_mid` ) ");
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+function update_r1066() {
+ $r = q("ALTER TABLE `site` ADD `site_access` INT NOT NULL DEFAULT '0' AFTER `site_url` ,
+ADD INDEX ( `site_access` )");
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+function update_r1067() {
+ $r = q("ALTER TABLE `updates` DROP PRIMARY KEY , ADD `ud_id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST, ADD INDEX ( `ud_hash` ) ");
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+function update_r1068(){
+ $r = q("ALTER TABLE `hubloc` ADD `hubloc_status` INT UNSIGNED NOT NULL DEFAULT '0' AFTER `hubloc_flags` , ADD INDEX ( `hubloc_status` )");
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+function update_r1069() {
+ $r = q("ALTER TABLE `site` ADD `site_sellpage` CHAR( 255 ) NOT NULL DEFAULT '',
+ADD INDEX ( `site_sellpage` )");
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+function update_r1070() {
+ $r = q("ALTER TABLE `updates` ADD `ud_flags` INT NOT NULL DEFAULT '0',
+ADD INDEX ( `ud_flags` )");
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+function update_r1071() {
+ $r = q("ALTER TABLE `updates` ADD `ud_addr` CHAR( 255 ) NOT NULL DEFAULT '',
+ADD INDEX ( `ud_addr` ) ");
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+function update_r1072() {
+ $r = q("ALTER TABLE `xtag` ADD `xtag_flags` INT NOT NULL DEFAULT '0',
+ADD INDEX ( `xtag_flags` ) ");
+
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+
+function update_r1073() {
+ $r1 = q("CREATE TABLE IF NOT EXISTS `source` (
+`src_id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
+`src_channel_id` INT UNSIGNED NOT NULL DEFAULT '0',
+`src_channel_xchan` CHAR( 255 ) NOT NULL DEFAULT '',
+`src_xchan` CHAR( 255 ) NOT NULL DEFAULT '',
+`src_patt` MEDIUMTEXT NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ");
+
+ $r2 = q("ALTER TABLE `source` ADD INDEX ( `src_channel_id` ), ADD INDEX ( `src_channel_xchan` ), ADD INDEX ( `src_xchan` ) ");
+
+ if($r1 && $r2)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+function update_r1074() {
+ $r1 = q("ALTER TABLE `site` ADD `site_sync` DATETIME NOT NULL AFTER `site_update` ");
+
+ $r2 = q("ALTER TABLE `updates` ADD `ud_last` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00' AFTER `ud_date` ,
+ADD INDEX ( `ud_last` ) ");
+
+ if($r1 && $r2)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+
+function update_r1075() {
+ $r = q("ALTER TABLE `channel` ADD `channel_a_republish` INT UNSIGNED NOT NULL DEFAULT '128',
+ADD INDEX ( `channel_a_republish` )");
+
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+function update_r1076() {
+ $r = q("ALTER TABLE `item` CHANGE `inform` `sig` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' ");
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+function update_r1077() {
+ $r = q("ALTER TABLE `item` ADD `source_xchan` CHAR( 255 ) NOT NULL DEFAULT '' AFTER `author_xchan` ");
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+function update_r1078() {
+ $r = q("ALTER TABLE `channel` ADD `channel_dirdate` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00' AFTER `channel_pageflags` , ADD INDEX ( `channel_dirdate` )");
+
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+function update_r1079() {
+ $r = q("ALTER TABLE `site` ADD `site_location` CHAR( 255 ) NOT NULL DEFAULT ''");
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+function update_r1080() {
+ $r = q("ALTER TABLE `mail` ADD `expires` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
+ADD INDEX ( `expires` ) ");
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+function update_r1081() {
+ $r = q("DROP TABLE `queue` ");
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+function update_r1082() {
+ $r = q("DROP TABLE `challenge` ");
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+function update_r1083() {
+ $r = q("ALTER TABLE `notify` ADD `aid` INT NOT NULL AFTER `msg` ,
+ADD INDEX ( `aid` )");
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+function update_r1084() {
+
+
+ $r = q("CREATE TABLE if not exists `sys_perms` (
+ `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
+ `cat` CHAR( 255 ) NOT NULL ,
+ `k` CHAR( 255 ) NOT NULL ,
+ `v` MEDIUMTEXT NOT NULL,
+ `public_perm` TINYINT( 1 ) UNSIGNED NOT NULL
+) ENGINE = MYISAM DEFAULT CHARSET = utf8");
+
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+
+}
+
+function update_r1085() {
+ $r1 = q("ALTER TABLE `photo` CHANGE `desc` `description` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ");
+
+ $r2 = q("RENAME TABLE `group` TO `groups`");
+
+ $r3 = q("ALTER TABLE `event` CHANGE `desc` `description` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ");
+
+ if($r1 && $r2 && $r3)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+
+}
+
+function update_r1086() {
+ $r = q("ALTER TABLE `account` ADD `account_level` INT UNSIGNED NOT NULL DEFAULT '0',
+ADD INDEX ( `account_level` )");
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+function update_r1087() {
+ $r = q("ALTER TABLE `xprof` ADD `xprof_about` TEXT NOT NULL DEFAULT '',
+ADD `xprof_homepage` CHAR( 255 ) NOT NULL DEFAULT '',
+ADD `xprof_hometown` CHAR( 255 ) NOT NULL DEFAULT '',
+ADD INDEX ( `xprof_hometown` )");
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+function update_r1088() {
+ $r = q("ALTER TABLE `obj` ADD `allow_cid` MEDIUMTEXT NOT NULL DEFAULT '',
+ADD `allow_gid` MEDIUMTEXT NOT NULL DEFAULT '',
+ADD `deny_cid` MEDIUMTEXT NOT NULL DEFAULT '',
+ADD `deny_gid` MEDIUMTEXT NOT NULL DEFAULT ''");
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+function update_r1089() {
+ $r = q("ALTER TABLE `attach` ADD `creator` CHAR( 128 ) NOT NULL DEFAULT '' AFTER `hash` ,
+ADD INDEX ( `creator` ) ");
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+
+function update_r1090() {
+ $r = q("ALTER TABLE `menu` ADD `menu_flags` INT NOT NULL DEFAULT '0',
+ADD INDEX ( `menu_flags` )");
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+function update_r1091() {
+ @mkdir('store/[data]/smarty',STORAGE_DEFAULT_PERMISSIONS,true);
+ @file_put_contents('store/[data]/locks','');
+ return UPDATE_SUCCESS;
+}
+
+function update_r1092() {
+ $r1 = q("CREATE TABLE IF NOT EXISTS `chat` (
+ `chat_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+ `chat_room` int(10) unsigned NOT NULL DEFAULT '0',
+ `chat_xchan` char(255) NOT NULL DEFAULT '',
+ `chat_text` mediumtext NOT NULL,
+ `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
+ PRIMARY KEY (`chat_id`),
+ KEY `chat_room` (`chat_room`),
+ KEY `chat_xchan` (`chat_xchan`),
+ KEY `created` (`created`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8");
+
+ $r2 = q("CREATE TABLE IF NOT EXISTS `chatpresence` (
+ `cp_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+ `cp_room` int(10) unsigned NOT NULL DEFAULT '0',
+ `cp_xchan` char(255) NOT NULL DEFAULT '',
+ `cp_last` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
+ `cp_status` char(255) NOT NULL,
+ PRIMARY KEY (`cp_id`),
+ KEY `cp_room` (`cp_room`),
+ KEY `cp_xchan` (`cp_xchan`),
+ KEY `cp_last` (`cp_last`),
+ KEY `cp_status` (`cp_status`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8");
+
+ $r3 = q("CREATE TABLE IF NOT EXISTS `chatroom` (
+ `cr_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+ `cr_aid` int(10) unsigned NOT NULL DEFAULT '0',
+ `cr_uid` int(10) unsigned NOT NULL DEFAULT '0',
+ `cr_name` char(255) NOT NULL DEFAULT '',
+ `cr_created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
+ `cr_edited` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
+ `allow_cid` mediumtext NOT NULL,
+ `allow_gid` mediumtext NOT NULL,
+ `deny_cid` mediumtext NOT NULL,
+ `deny_gid` mediumtext NOT NULL,
+ PRIMARY KEY (`cr_id`),
+ KEY `cr_aid` (`cr_aid`),
+ KEY `cr_uid` (`cr_uid`),
+ KEY `cr_name` (`cr_name`),
+ KEY `cr_created` (`cr_created`),
+ KEY `cr_edited` (`cr_edited`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8");
+
+
+ if($r1 && $r2 && $r3)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+
+
+
+function update_r1093() {
+ $r = q("ALTER TABLE `chatpresence` ADD `cp_client` CHAR( 128 ) NOT NULL DEFAULT ''");
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+function update_r1094() {
+ $r = q("ALTER TABLE `chatroom` ADD `cr_expire` INT UNSIGNED NOT NULL DEFAULT '0' AFTER `cr_edited` ,
+ADD INDEX ( `cr_expire` )");
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+function update_r1095() {
+ $r = q("ALTER TABLE `channel` ADD `channel_a_bookmark` INT UNSIGNED NOT NULL DEFAULT '128',
+ADD INDEX ( `channel_a_bookmark` )");
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+function update_r1096() {
+ $r = q("ALTER TABLE `account` CHANGE `account_level` `account_level` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0'");
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+function update_r1097() {
+
+ // fix some mangled hublocs from a bug long ago
+
+ $r = q("select hubloc_id, hubloc_addr from hubloc where hubloc_addr like '%%/%%'");
+ if($r) {
+ foreach($r as $rr) {
+ q("update hubloc set hubloc_addr = '%s' where hubloc_id = %d limit 1",
+ dbesc(substr($rr['hubloc_addr'],0,strpos($rr['hubloc_addr'],'/'))),
+ intval($rr['hubloc_id'])
+ );
+ }
+ }
+ return UPDATE_SUCCESS;
+
+}
+
+function update_r1098() {
+ $r = q("ALTER TABLE `channel` CHANGE `channel_r_stream` `channel_r_stream` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0'");
+ $r2 = q("ALTER TABLE `channel` CHANGE `channel_r_profile` `channel_r_profile` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0'");
+ $r3 = q("ALTER TABLE `channel` CHANGE `channel_r_photos` `channel_r_photos` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0'");
+ $r4 = q("ALTER TABLE `channel` CHANGE `channel_r_abook` `channel_r_abook` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0'");
+ $r4 = q("ALTER TABLE `channel` CHANGE `channel_w_stream` `channel_w_stream` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0'");
+ $r5 = q("ALTER TABLE `channel` CHANGE `channel_w_wall` `channel_w_wall` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0'");
+ $r6 = q("ALTER TABLE `channel` CHANGE `channel_w_tagwall` `channel_w_tagwall` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0'");
+ $r7 = q("ALTER TABLE `channel` CHANGE `channel_w_comment` `channel_w_comment` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0'");
+ $r8 = q("ALTER TABLE `channel` CHANGE `channel_w_mail` `channel_w_mail` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0'");
+ $r9 = q("ALTER TABLE `channel` CHANGE `channel_w_photos` `channel_w_photos` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0'");
+ $r10 = q("ALTER TABLE `channel` CHANGE `channel_w_chat` `channel_w_chat` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0'");
+ $r11 = q("ALTER TABLE `channel` CHANGE `channel_a_delegate` `channel_a_delegate` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0'");
+ if($r && $r2 && $r3 && $r3 && $r5 && $r6 && $r7 && $r8 && $r9 && $r9 && $r10 && $r11)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+function update_r1099() {
+ $r = q("CREATE TABLE IF NOT EXISTS `xchat` (
+ `xchat_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+ `xchat_url` char(255) NOT NULL DEFAULT '',
+ `xchat_desc` char(255) NOT NULL DEFAULT '',
+ `xchat_xchan` char(255) NOT NULL DEFAULT '',
+ PRIMARY KEY (`xchat_id`),
+ KEY `xchat_url` (`xchat_url`),
+ KEY `xchat_desc` (`xchat_desc`),
+ KEY `xchat_xchan` (`xchat_xchan`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ");
+
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+function update_r1100() {
+ $r = q("ALTER TABLE `xchat` ADD `xchat_edited` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
+ADD INDEX ( `xchat_edited` ) ");
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+
+function update_r1101() {
+ $r = q("update updates set ud_flags = 2 where ud_flags = (-1)");
+ $r = q("update updates set ud_flags = 0 where ud_flags = 4096");
+ return UPDATE_SUCCESS;
+}
+
+function update_r1102() {
+ $r = q("update abook set abook_flags = (abook_flags - %d)
+ where ( abook_flags & %d)",
+ intval(ABOOK_FLAG_UNCONNECTED),
+ intval(ABOOK_FLAG_UNCONNECTED)
+ );
+ return UPDATE_SUCCESS;
+}
+
+function update_r1103() {
+ $x = curl_version();
+ if(stristr($x['ssl_version'],'openssl'))
+ set_config('system','curl_ssl_ciphers','ALL:!eNULL');
+ return UPDATE_SUCCESS;
+}
+
+function update_r1104() {
+ $r = q("ALTER TABLE `item` ADD `route` TEXT NOT NULL DEFAULT '' AFTER `postopts` ");
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+function update_r1105() {
+ $r = q("ALTER TABLE `site` ADD `site_pull` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00' AFTER `site_update` ,
+CHANGE `site_sync` `site_sync` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', ADD INDEX ( `site_pull` ) ");
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+function update_r1106() {
+ $r = q("ALTER TABLE `notify` CHANGE `parent` `parent` CHAR( 255 ) NOT NULL DEFAULT ''");
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+function update_r1107() {
+ $r = q("CREATE TABLE IF NOT EXISTS `app` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `app_id` char(64) NOT NULL DEFAULT '',
+ `app_sig` char(255) NOT NULL DEFAULT '',
+ `app_author` char(255) NOT NULL DEFAULT '',
+ `app_name` char(255) NOT NULL DEFAULT '',
+ `app_desc` text NOT NULL,
+ `app_url` char(255) NOT NULL DEFAULT '',
+ `app_photo` char(255) NOT NULL DEFAULT '',
+ `app_version` char(255) NOT NULL DEFAULT '',
+ `app_channel` int(11) NOT NULL DEFAULT '0',
+ PRIMARY KEY (`id`),
+ KEY `app_id` (`app_id`),
+ KEY `app_name` (`app_name`),
+ KEY `app_url` (`app_url`),
+ KEY `app_photo` (`app_photo`),
+ KEY `app_version` (`app_version`),
+ KEY `app_channel` (`app_channel`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ");
+
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+
+function update_r1108() {
+ $r = q("ALTER TABLE `app` ADD `app_addr` CHAR( 255 ) NOT NULL DEFAULT '',
+ADD `app_price` CHAR( 255 ) NOT NULL DEFAULT '',
+ADD `app_page` CHAR( 255 ) NOT NULL DEFAULT '',
+ADD INDEX ( `app_price` )");
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+function update_r1109() {
+ $r = q("ALTER TABLE `app` CHANGE `app_id` `app_id` CHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT ''");
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+
+// We ended up with an extra zero in the name for 1108, so do it over and ignore the result.
+
+function update_r1110() {
+ $r = q("ALTER TABLE `app` ADD `app_addr` CHAR( 255 ) NOT NULL DEFAULT '',
+ADD `app_price` CHAR( 255 ) NOT NULL DEFAULT '',
+ADD `app_page` CHAR( 255 ) NOT NULL DEFAULT '',
+ADD INDEX ( `app_price` )");
+
+ return UPDATE_SUCCESS;
+
+}
+
+function update_r1111() {
+ $r = q("ALTER TABLE `app` ADD `app_requires` CHAR( 255 ) NOT NULL DEFAULT '' ");
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}