Merge branch 'dev' into oauth2

This commit is contained in:
Andrew Manning 2018-02-20 21:11:59 -05:00
commit 8e5c1135c3
219 changed files with 4768 additions and 3312 deletions

View file

@ -640,7 +640,21 @@ class Notifier {
} }
else { else {
$env = (($hub_env && $hub_env[$hub['hubloc_host'] . $hub['hubloc_sitekey']]) ? $hub_env[$hub['hubloc_host'] . $hub['hubloc_sitekey']] : ''); $env = (($hub_env && $hub_env[$hub['hubloc_host'] . $hub['hubloc_sitekey']]) ? $hub_env[$hub['hubloc_host'] . $hub['hubloc_sitekey']] : '');
// currently zot6 delivery is only performed on normal items and not sync items or mail or anything else
// Eventually we will do this for all deliveries, but for now ensure this is precisely what we are dealing
// with before switching to zot6 as the primary zot6 handler checks for the existence of a message delivery report
// to trigger dequeue'ing
$z6 = (($encoded_item && $encoded_item['type'] === 'activity' && (! array_key_exists('allow_cid',$encoded_item))) ? true : false);
if($z6) {
$packet = zot6_build_packet($channel,'notify',$env, json_encode($encoded_item), (($private) ? $hub['hubloc_sitekey'] : null), $hub['site_crypto'],$hash); $packet = zot6_build_packet($channel,'notify',$env, json_encode($encoded_item), (($private) ? $hub['hubloc_sitekey'] : null), $hub['site_crypto'],$hash);
}
else {
$packet = zot_build_packet($channel,'notify',$env, (($private) ? $hub['hubloc_sitekey'] : null), $hub['site_crypto'],$hash);
}
queue_insert( queue_insert(
[ [
'hash' => $hash, 'hash' => $hash,

View file

@ -2,42 +2,33 @@
namespace Zotlabs\Identity; namespace Zotlabs\Identity;
class OAuth2Server { class OAuth2Server extends \OAuth2\Server {
public $server; public function __construct(OAuth2Storage $storage, $config = []) {
public function __construct() {
$storage = new OAuth2Storage(\DBA::$dba->db);
if(! is_array($config)) {
$config = [ $config = [
'use_openid_connect' => true, 'use_openid_connect' => true,
'issuer' => \Zotlabs\Lib\System::get_site_name() 'issuer' => \Zotlabs\Lib\System::get_site_name()
]; ];
}
// Pass a storage object or array of storage objects to the OAuth2 server class parent::__construct($storage, $config);
$this->server = new \OAuth2\Server($storage,$config);
// Add the "Client Credentials" grant type (it is the simplest of the grant types) // Add the "Client Credentials" grant type (it is the simplest of the grant types)
$this->server->addGrantType(new \OAuth2\GrantType\ClientCredentials($storage)); $this->addGrantType(new \OAuth2\GrantType\ClientCredentials($storage));
// Add the "Authorization Code" grant type (this is where the oauth magic happens) // Add the "Authorization Code" grant type (this is where the oauth magic happens)
$this->server->addGrantType(new \OAuth2\GrantType\AuthorizationCode($storage)); $this->addGrantType(new \OAuth2\GrantType\AuthorizationCode($storage));
$keyStorage = new \OAuth2\Storage\Memory( [ $keyStorage = new \OAuth2\Storage\Memory( [
'keys' => [ 'keys' => [
'public_key' => get_config('system','pubkey'), 'public_key' => get_config('system', 'pubkey'),
'private_key' => get_config('system','prvkey') 'private_key' => get_config('system', 'prvkey')
] ]
]); ]);
$this->server->addStorage($keyStorage,'public_key'); $this->addStorage($keyStorage, 'public_key');
} }
public function get_server() {
return $this->server;
}
} }

View file

@ -10,22 +10,12 @@ class DB_Upgrade {
function __construct($db_revision) { function __construct($db_revision) {
$platform_name = System::get_platform_name();
$update_file = 'install/' . $platform_name . '/update.php';
if(! file_exists($update_file)) {
$update_file = 'install/update.php';
$this->config_name = 'db_version'; $this->config_name = 'db_version';
$this->func_prefix = 'update_r'; $this->func_prefix = '_';
}
else {
$this->config_name = $platform_name . '_db_version';
$this->func_prefix = $platform_name . '_update_';
}
$build = get_config('system', $this->config_name, 0); $build = get_config('system', 'db_version', 0);
if(! intval($build)) if(! intval($build))
$build = set_config('system', $this->config_name, $db_revision); $build = set_config('system', 'db_version', $db_revision);
if($build == $db_revision) { if($build == $db_revision) {
// Nothing to be done. // Nothing to be done.
@ -40,23 +30,18 @@ class DB_Upgrade {
$current = intval($db_revision); $current = intval($db_revision);
if(($stored < $current) && file_exists($update_file)) { if($stored < $current) {
Config::Load('database'); // The last update we performed was $stored.
// Start at $stored + 1 and continue until we have completed $current
// We're reporting a different version than what is currently installed. for($x = $stored + 1; $x <= $current; $x ++) {
// Run any existing update scripts to bring the database up to current. $s = '_' . $x;
$cls = '\\Zotlabs\Update\\' . $s ;
if(! class_exists($cls)) {
return;
}
require_once($update_file);
// make sure that boot.php and update.php are the same release, we might be
// updating from git right this very second and the correct version of the update.php
// file may not be here yet. This can happen on a very busy site.
if($db_revision == UPDATE_VERSION) {
for($x = $stored; $x < $current; $x ++) {
$func = $this->func_prefix . $x;
if(function_exists($func)) {
// There could be a lot of processes running or about to run. // There could be a lot of processes running or about to run.
// We want exactly one process to run the update command. // We want exactly one process to run the update command.
// So store the fact that we're taking responsibility // So store the fact that we're taking responsibility
@ -65,13 +50,17 @@ class DB_Upgrade {
// If the update fails or times-out completely you may need to // If the update fails or times-out completely you may need to
// delete the config entry to try again. // delete the config entry to try again.
if(get_config('database', $func)) Config::Load('database');
break;
set_config('database',$func, '1');
// call the specific update
$retval = $func(); if(get_config('database', $s))
if($retval) { break;
set_config('database',$s, '1');
$c = new $cls();
$retval = $c->run();
if($retval != UPDATE_SUCCESS) {
// Prevent sending hundreds of thousands of emails by creating // Prevent sending hundreds of thousands of emails by creating
// a lockfile. // a lockfile.
@ -88,7 +77,6 @@ class DB_Upgrade {
dbesc(\App::$config['system']['admin_email']) dbesc(\App::$config['system']['admin_email'])
); );
push_lang(($r) ? $r[0]['account_language'] : 'en'); push_lang(($r) ? $r[0]['account_language'] : 'en');
z_mail( z_mail(
[ [
'toEmail' => \App::$config['system']['admin_email'], 'toEmail' => \App::$config['system']['admin_email'],
@ -109,13 +97,11 @@ class DB_Upgrade {
pop_lang(); pop_lang();
} }
else { else {
set_config('database',$func, 'success'); set_config('database',$s, 'success');
} }
} }
} }
set_config('system', $this->config_name, $db_revision); set_config('system', 'db_version', $db_revision);
}
}
} }
} }
} }

View file

@ -7,36 +7,38 @@ namespace Zotlabs\Module\Admin;
class Dbsync { class Dbsync {
function get() { function get() {
$o = ''; $o = '';
if(argc() > 3 && intval(argv(3)) && argv(2) === 'mark') { if(argc() > 3 && intval(argv(3)) && argv(2) === 'mark') {
set_config('database', 'update_r' . intval(argv(3)), 'success'); // remove the old style config if it exists
if(intval(get_config('system','db_version')) <= intval(argv(3))) del_config('database', 'update_r' . intval(argv(3)));
set_config('system','db_version',intval(argv(3)) + 1); set_config('database', '_' . intval(argv(3)), 'success');
if(intval(get_config('system','db_version')) < intval(argv(3)))
set_config('system','db_version',intval(argv(3)));
info( t('Update has been marked successful') . EOL); info( t('Update has been marked successful') . EOL);
goaway(z_root() . '/admin/dbsync'); goaway(z_root() . '/admin/dbsync');
} }
if(argc() > 2 && intval(argv(2))) { if(argc() > 2 && intval(argv(2))) {
require_once('install/update.php'); $x = intval(argv(2));
$func = 'update_r' . intval(argv(2)); $s = '_' . $x;
if(function_exists($func)) { $cls = '\\Zotlabs\Update\\' . $s ;
$retval = $func(); if(class_exists($cls)) {
$c = new $cls();
$retval = $c->run();
if($retval === UPDATE_FAILED) { if($retval === UPDATE_FAILED) {
$o .= sprintf( t('Executing %s failed. Check system logs.'), $func); $o .= sprintf( t('Executing %s failed. Check system logs.'), $s);
} }
elseif($retval === UPDATE_SUCCESS) { elseif($retval === UPDATE_SUCCESS) {
$o .= sprintf( t('Update %s was successfully applied.'), $func); $o .= sprintf( t('Update %s was successfully applied.'), $s);
set_config('database',$func, 'success'); set_config('database',$s, 'success');
} }
else else
$o .= sprintf( t('Update %s did not return a status. Unknown if it succeeded.'), $func); $o .= sprintf( t('Update %s did not return a status. Unknown if it succeeded.'), $s);
} }
else else
$o .= sprintf( t('Update function %s could not be found.'), $func); $o .= sprintf( t('Update function %s could not be found.'), $s);
return $o; return $o;
} }
@ -45,15 +47,13 @@ class Dbsync {
$r = q("select * from config where cat = 'database' "); $r = q("select * from config where cat = 'database' ");
if(count($r)) { if(count($r)) {
foreach($r as $rr) { foreach($r as $rr) {
$upd = intval(substr($rr['k'],8)); $upd = intval(substr($rr['k'],-4));
if($rr['v'] === 'success') if($rr['v'] === 'success')
continue; continue;
$failed[] = $upd; $failed[] = $upd;
} }
} }
if(! count($failed)) if(count($failed)) {
return '<div class="generic-content-wrapper-styled"><h3>' . t('No failed updates.') . '</h3></div>';
$o = replace_macros(get_markup_template('failed_updates.tpl'),array( $o = replace_macros(get_markup_template('failed_updates.tpl'),array(
'$base' => z_root(), '$base' => z_root(),
'$banner' => t('Failed Updates'), '$banner' => t('Failed Updates'),
@ -62,6 +62,10 @@ class Dbsync {
'$apply' => t('Attempt to execute this update step automatically'), '$apply' => t('Attempt to execute this update step automatically'),
'$failed' => $failed '$failed' => $failed
)); ));
}
else {
return '<div class="generic-content-wrapper-styled"><h3>' . t('No failed updates.') . '</h3></div>';
}
return $o; return $o;
} }

View file

@ -2,13 +2,13 @@
namespace Zotlabs\Module; namespace Zotlabs\Module;
use Zotlabs\Identity\OAuth2Storage;
class Authorize extends \Zotlabs\Web\Controller { class Authorize extends \Zotlabs\Web\Controller {
function init() { function init() {
// workaround for HTTP-auth in CGI mode // workaround for HTTP-auth in CGI mode
if (x($_SERVER, 'REDIRECT_REMOTE_USER')) { if (x($_SERVER, 'REDIRECT_REMOTE_USER')) {
$userpass = base64_decode(substr($_SERVER["REDIRECT_REMOTE_USER"], 6)) ; $userpass = base64_decode(substr($_SERVER["REDIRECT_REMOTE_USER"], 6)) ;
@ -28,13 +28,13 @@ class Authorize extends \Zotlabs\Web\Controller {
} }
} }
$s = new \Zotlabs\Identity\OAuth2Server(); $s = new \Zotlabs\Identity\OAuth2Server(new OAuth2Storage(\DBA::$dba->db));
$request = \OAuth2\Request::createFromGlobals(); $request = \OAuth2\Request::createFromGlobals();
$response = new \OAuth2\Response(); $response = new \OAuth2\Response();
// validate the authorize request // validate the authorize request
if (! $s->server->validateAuthorizeRequest($request, $response)) { if (! $s->validateAuthorizeRequest($request, $response)) {
$response->send(); $response->send();
killme(); killme();
} }
@ -52,13 +52,12 @@ class Authorize extends \Zotlabs\Web\Controller {
// print the authorization code if the user has authorized your client // print the authorization code if the user has authorized your client
$is_authorized = ($_POST['authorized'] === 'yes'); $is_authorized = ($_POST['authorized'] === 'yes');
$s->server->handleAuthorizeRequest($request, $response, $is_authorized, local_channel()); $s->handleAuthorizeRequest($request, $response, $is_authorized, local_channel());
if ($is_authorized) { if ($is_authorized) {
// this is only here so that you get to see your code in the cURL request. Otherwise, // this is only here so that you get to see your code in the cURL request. Otherwise,
// we'd redirect back to the client // we'd redirect back to the client
$code = substr($response->getHttpHeader('Location'), strpos($response->getHttpHeader('Location'), 'code=')+5, 40); $code = substr($response->getHttpHeader('Location'), strpos($response->getHttpHeader('Location'), 'code=')+5, 40);
echo("SUCCESS! Authorization Code: $code"); echo("SUCCESS! Authorization Code: $code");
} }
$response->send(); $response->send();

View file

@ -2,6 +2,8 @@
namespace Zotlabs\Module; namespace Zotlabs\Module;
use Zotlabs\Identity\OAuth2Storage;
class Token extends \Zotlabs\Web\Controller { class Token extends \Zotlabs\Web\Controller {
@ -26,9 +28,8 @@ class Token extends \Zotlabs\Web\Controller {
} }
} }
$s = new \Zotlabs\Identity\OAuth2Server(new OAuth2Storage(\DBA::$dba->db));
$s = new \Zotlabs\Identity\OAuth2Server(); $s->handleTokenRequest(\OAuth2\Request::createFromGlobals())->send();
$s->server->handleTokenRequest(\OAuth2\Request::createFromGlobals())->send();
killme(); killme();
} }

15
Zotlabs/Update/_1000.php Normal file
View file

@ -0,0 +1,15 @@
<?php
namespace Zotlabs\Update;
class _1000 {
function run() {
$r = q("ALTER TABLE `channel` ADD `channel_a_delegate` TINYINT( 3 ) UNSIGNED NOT NULL DEFAULT '0', ADD INDEX ( `channel_a_delegate` )");
if($r)
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}
}

27
Zotlabs/Update/_1001.php Normal file
View file

@ -0,0 +1,27 @@
<?php
namespace Zotlabs\Update;
class _1001 {
function run() {
$r = q("CREATE TABLE if not exists `verify` (
`id` INT(10) UNSIGNED NOT NULL ,
`channel` INT(10) UNSIGNED NOT NULL DEFAULT '0',
`type` CHAR( 32 ) NOT NULL DEFAULT '',
`token` CHAR( 255 ) NOT NULL DEFAULT '',
`meta` CHAR( 255 ) NOT NULL DEFAULT '',
`created` DATETIME NOT NULL DEFAULT '0001-01-01 00:00:00',
PRIMARY KEY ( `id` )
) 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`)");
if($r && $r2)
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}
}

20
Zotlabs/Update/_1002.php Normal file
View file

@ -0,0 +1,20 @@
<?php
namespace Zotlabs\Update;
class _1002 {
function run() {
$r = q("ALTER TABLE `event` CHANGE `account` `aid` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0'");
$r2 = q("alter table `event` drop index `account`, add index (`aid`)");
q("drop table contact");
q("drop table deliverq");
if($r && $r2)
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}
}

15
Zotlabs/Update/_1003.php Normal file
View file

@ -0,0 +1,15 @@
<?php
namespace Zotlabs\Update;
class _1003 {
function run() {
$r = q("ALTER TABLE `xchan` ADD `xchan_flags` INT UNSIGNED NOT NULL DEFAULT '0' AFTER `xchan_network` ,
ADD INDEX ( `xchan_flags` ) ");
if($r)
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}
}

24
Zotlabs/Update/_1004.php Normal file
View file

@ -0,0 +1,24 @@
<?php
namespace Zotlabs\Update;
class _1004 {
function run() {
$r = q("CREATE TABLE if not exists `site` (
`site_url` CHAR( 255 ) NOT NULL ,
`site_flags` INT NOT NULL DEFAULT '0',
`site_update` DATETIME NOT NULL DEFAULT '0001-01-01 00:00:00',
`site_directory` CHAR( 255 ) NOT NULL DEFAULT '',
PRIMARY KEY ( `site_url` )
) ENGINE = MYISAM DEFAULT CHARSET=utf8");
$r2 = q("alter table site add index (site_flags), add index (site_update), add index (site_directory) ");
if($r && $r2)
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}
}

13
Zotlabs/Update/_1005.php Normal file
View file

@ -0,0 +1,13 @@
<?php
namespace Zotlabs\Update;
class _1005 {
function run() {
q("drop table guid");
q("drop table `notify-threads`");
return UPDATE_SUCCESS;
}
}

45
Zotlabs/Update/_1006.php Normal file
View file

@ -0,0 +1,45 @@
<?php
namespace Zotlabs\Update;
class _1006 {
function run() {
$r = q("CREATE TABLE IF NOT EXISTS `xprof` (
`xprof_hash` char(255) NOT NULL,
`xprof_desc` char(255) NOT NULL DEFAULT '',
`xprof_dob` char(12) NOT NULL DEFAULT '',
`xprof_gender` char(255) NOT NULL DEFAULT '',
`xprof_marital` char(255) NOT NULL DEFAULT '',
`xprof_sexual` char(255) NOT NULL DEFAULT '',
`xprof_locale` char(255) NOT NULL DEFAULT '',
`xprof_region` char(255) NOT NULL DEFAULT '',
`xprof_postcode` char(32) NOT NULL DEFAULT '',
`xprof_country` char(255) NOT NULL DEFAULT '',
PRIMARY KEY (`xprof_hash`),
KEY `xprof_desc` (`xprof_desc`),
KEY `xprof_dob` (`xprof_dob`),
KEY `xprof_gender` (`xprof_gender`),
KEY `xprof_marital` (`xprof_marital`),
KEY `xprof_sexual` (`xprof_sexual`),
KEY `xprof_locale` (`xprof_locale`),
KEY `xprof_region` (`xprof_region`),
KEY `xprof_postcode` (`xprof_postcode`),
KEY `xprof_country` (`xprof_country`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8");
$r2 = q("CREATE TABLE IF NOT EXISTS `xtag` (
`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");
if($r && $r2)
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}
}

15
Zotlabs/Update/_1007.php Normal file
View file

@ -0,0 +1,15 @@
<?php
namespace Zotlabs\Update;
class _1007 {
function run() {
$r = q("ALTER TABLE `channel` ADD `channel_r_storage` INT UNSIGNED NOT NULL DEFAULT '128', ADD `channel_w_storage` INT UNSIGNED NOT NULL DEFAULT '128', add index ( channel_r_storage ), add index ( channel_w_storage )");
if($r && $r2)
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}
}

15
Zotlabs/Update/_1008.php Normal file
View file

@ -0,0 +1,15 @@
<?php
namespace Zotlabs\Update;
class _1008 {
function run() {
$r = q("alter table profile drop prv_keywords, CHANGE `pub_keywords` `keywords` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, drop index pub_keywords");
if($r)
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}
}

15
Zotlabs/Update/_1009.php Normal file
View file

@ -0,0 +1,15 @@
<?php
namespace Zotlabs\Update;
class _1009 {
function run() {
$r = q("ALTER TABLE `xprof` ADD `xprof_keywords` TEXT NOT NULL");
if($r)
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}
}

18
Zotlabs/Update/_1010.php Normal file
View file

@ -0,0 +1,18 @@
<?php
namespace Zotlabs\Update;
class _1010 {
function run() {
$r = q("ALTER TABLE `abook` ADD `abook_dob` DATETIME NOT NULL DEFAULT '0001-01-01 00:00:00' AFTER `abook_connnected` ,
ADD INDEX ( `abook_dob` )");
$r2 = q("ALTER TABLE `profile` ADD `dob_tz` CHAR( 255 ) NOT NULL DEFAULT 'UTC' AFTER `dob`");
if($r && $r2)
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}
}

16
Zotlabs/Update/_1011.php Normal file
View file

@ -0,0 +1,16 @@
<?php
namespace Zotlabs\Update;
class _1011 {
function run() {
$r = q("ALTER TABLE `item` ADD `expires` DATETIME NOT NULL DEFAULT '0001-01-01 00:00:00' AFTER `edited` ,
ADD INDEX ( `expires` )");
if($r)
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}
}

16
Zotlabs/Update/_1012.php Normal file
View file

@ -0,0 +1,16 @@
<?php
namespace Zotlabs\Update;
class _1012 {
function run() {
$r = q("ALTER TABLE `xchan` ADD `xchan_connurl` CHAR( 255 ) NOT NULL DEFAULT '' AFTER `xchan_url` ,
ADD INDEX ( `xchan_connurl` )");
if($r)
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}
}

21
Zotlabs/Update/_1013.php Normal file
View file

@ -0,0 +1,21 @@
<?php
namespace Zotlabs\Update;
class _1013 {
function run() {
$r = q("CREATE TABLE if not exists `xlink` (
`xlink_id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`xlink_xchan` CHAR( 255 ) NOT NULL DEFAULT '',
`xlink_link` CHAR( 255 ) NOT NULL DEFAULT '',
`xlink_updated` DATETIME NOT NULL DEFAULT '0001-01-01 00:00:00'
) 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)
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}
}

14
Zotlabs/Update/_1014.php Normal file
View file

@ -0,0 +1,14 @@
<?php
namespace Zotlabs\Update;
class _1014 {
function run() {
$r = q("ALTER TABLE `verify` CHANGE `id` `id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT");
if($r)
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}
}

19
Zotlabs/Update/_1015.php Normal file
View file

@ -0,0 +1,19 @@
<?php
namespace Zotlabs\Update;
class _1015 {
function run() {
$r = q("ALTER TABLE `channel` ADD `channel_r_pages` INT UNSIGNED NOT NULL DEFAULT '128',
ADD `channel_w_pages` INT UNSIGNED NOT NULL DEFAULT '128'");
$r2 = q("ALTER TABLE `channel` ADD INDEX ( `channel_r_pages` ) , ADD INDEX ( `channel_w_pages` ) ");
if($r && $r2)
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}
}

39
Zotlabs/Update/_1016.php Normal file
View file

@ -0,0 +1,39 @@
<?php
namespace Zotlabs\Update;
class _1016 {
function run() {
$r = q("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_desc` char(255) NOT NULL DEFAULT '',
PRIMARY KEY (`menu_id`),
KEY `menu_channel_id` (`menu_channel_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ");
$r2 = q("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 '',
`allow_cid` mediumtext NOT NULL,
`allow_gid` mediumtext NOT NULL,
`deny_cid` mediumtext NOT NULL,
`deny_gid` mediumtext NOT NULL,
`mitem_channel_id` int(10) unsigned NOT NULL,
`mitem_menu_id` int(10) unsigned NOT NULL DEFAULT '0',
`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 ");
if($r && $r2)
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}
}

14
Zotlabs/Update/_1017.php Normal file
View file

@ -0,0 +1,14 @@
<?php
namespace Zotlabs\Update;
class _1017 {
function run() {
$r = q("ALTER TABLE `event` CHANGE `cid` `event_xchan` CHAR( 255 ) NOT NULL DEFAULT '', ADD INDEX ( `event_xchan` ), drop index cid ");
if($r)
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}
}

16
Zotlabs/Update/_1018.php Normal file
View file

@ -0,0 +1,16 @@
<?php
namespace Zotlabs\Update;
class _1018 {
function run() {
$r = q("ALTER TABLE `event` ADD `event_hash` CHAR( 255 ) NOT NULL DEFAULT '' AFTER `event_xchan` ,
ADD INDEX ( `event_hash` )");
if($r)
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}
}

14
Zotlabs/Update/_1019.php Normal file
View file

@ -0,0 +1,14 @@
<?php
namespace Zotlabs\Update;
class _1019 {
function run() {
$r = q("ALTER TABLE `event` DROP `message_id` ");
if($r)
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}
}

14
Zotlabs/Update/_1020.php Normal file
View file

@ -0,0 +1,14 @@
<?php
namespace Zotlabs\Update;
class _1020 {
function run() {
$r = q("alter table photo drop `contact-id`, drop guid, drop index `resource-id`, add index ( `resource_id` )");
if($r)
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}
}

17
Zotlabs/Update/_1021.php Normal file
View file

@ -0,0 +1,17 @@
<?php
namespace Zotlabs\Update;
class _1021 {
function run() {
$r = q("ALTER TABLE `abook` CHANGE `abook_connnected` `abook_connected` DATETIME NOT NULL DEFAULT '0001-01-01 00:00:00',
drop index `abook_connnected`, add index ( `abook_connected` ) ");
if($r)
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}
}

14
Zotlabs/Update/_1022.php Normal file
View file

@ -0,0 +1,14 @@
<?php
namespace Zotlabs\Update;
class _1022 {
function run() {
$r = q("alter table attach add index ( filename ), add index ( filetype ), add index ( filesize ), add index ( created ), add index ( edited ) ");
if($r)
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}
}

14
Zotlabs/Update/_1023.php Normal file
View file

@ -0,0 +1,14 @@
<?php
namespace Zotlabs\Update;
class _1023 {
function run() {
$r = q("ALTER TABLE `item` ADD `revision` INT UNSIGNED NOT NULL DEFAULT '0' AFTER `lang` , add index ( revision ) ");
if($r)
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}
}

15
Zotlabs/Update/_1024.php Normal file
View file

@ -0,0 +1,15 @@
<?php
namespace Zotlabs\Update;
class _1024 {
function run() {
$r = q("ALTER TABLE `attach` ADD `revision` INT UNSIGNED NOT NULL DEFAULT '0' AFTER `filesize` ,
ADD INDEX ( `revision` ) ");
if($r)
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}
}

15
Zotlabs/Update/_1025.php Normal file
View file

@ -0,0 +1,15 @@
<?php
namespace Zotlabs\Update;
class _1025 {
function run() {
$r = q("ALTER TABLE `attach` ADD `folder` CHAR( 64 ) NOT NULL DEFAULT '' AFTER `revision` ,
ADD `flags` INT UNSIGNED NOT NULL DEFAULT '0' AFTER `folder` , add index ( folder ), add index ( flags )");
if($r)
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}
}

16
Zotlabs/Update/_1026.php Normal file
View file

@ -0,0 +1,16 @@
<?php
namespace Zotlabs\Update;
class _1026 {
function run() {
$r = q("ALTER TABLE `item` ADD `mimetype` CHAR( 255 ) NOT NULL DEFAULT '' AFTER `author_xchan` ,
ADD INDEX ( `mimetype` )");
if($r)
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}
}

15
Zotlabs/Update/_1027.php Normal file
View file

@ -0,0 +1,15 @@
<?php
namespace Zotlabs\Update;
class _1027 {
function run() {
$r = q("ALTER TABLE `abook` ADD `abook_rating` INT NOT NULL DEFAULT '0' AFTER `abook_closeness` ,
ADD INDEX ( `abook_rating` )");
if($r)
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}
}

15
Zotlabs/Update/_1028.php Normal file
View file

@ -0,0 +1,15 @@
<?php
namespace Zotlabs\Update;
class _1028 {
function run() {
$r = q("ALTER TABLE `xlink` ADD `xlink_rating` INT NOT NULL DEFAULT '0' AFTER `xlink_link` ,
ADD INDEX ( `xlink_rating` ) ");
if($r)
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}
}

15
Zotlabs/Update/_1029.php Normal file
View file

@ -0,0 +1,15 @@
<?php
namespace Zotlabs\Update;
class _1029 {
function run() {
$r = q("ALTER TABLE `channel` ADD `channel_deleted` DATETIME NOT NULL DEFAULT '0001-01-01 00:00:00' AFTER `channel_pageflags` ,
ADD INDEX ( `channel_deleted` ) ");
if($r)
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}
}

29
Zotlabs/Update/_1030.php Normal file
View file

@ -0,0 +1,29 @@
<?php
namespace Zotlabs\Update;
class _1030 {
function run() {
$r = q("CREATE TABLE IF NOT EXISTS `issue` (
`issue_id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`issue_created` DATETIME NOT NULL DEFAULT '0001-01-01 00:00:00',
`issue_updated` DATETIME NOT NULL DEFAULT '0001-01-01 00:00:00',
`issue_assigned` CHAR( 255 ) NOT NULL ,
`issue_priority` INT NOT NULL ,
`issue_status` INT NOT NULL ,
`issue_component` CHAR( 255 ) NOT NULL,
KEY `issue_created` (`issue_created`),
KEY `issue_updated` (`issue_updated`),
KEY `issue_assigned` (`issue_assigned`),
KEY `issue_priority` (`issue_priority`),
KEY `issue_status` (`issue_status`),
KEY `issue_component` (`issue_component`)
) ENGINE = MYISAM DEFAULT CHARSET=utf8");
if($r)
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}
}

16
Zotlabs/Update/_1031.php Normal file
View file

@ -0,0 +1,16 @@
<?php
namespace Zotlabs\Update;
class _1031 {
function run() {
$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;
}
}

21
Zotlabs/Update/_1032.php Normal file
View file

@ -0,0 +1,21 @@
<?php
namespace Zotlabs\Update;
class _1032 {
function run() {
$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;
}
}

29
Zotlabs/Update/_1033.php Normal file
View file

@ -0,0 +1,29 @@
<?php
namespace Zotlabs\Update;
class _1033 {
function run() {
$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;
}
}

20
Zotlabs/Update/_1034.php Normal file
View file

@ -0,0 +1,20 @@
<?php
namespace Zotlabs\Update;
class _1034 {
function run() {
$r = q("CREATE TABLE if not exists `updates` (
`ud_hash` CHAR( 128 ) NOT NULL ,
`ud_date` DATETIME NOT NULL DEFAULT '0001-01-01 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;
}
}

24
Zotlabs/Update/_1035.php Normal file
View file

@ -0,0 +1,24 @@
<?php
namespace Zotlabs\Update;
class _1035 {
function run() {
$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;
}
}

16
Zotlabs/Update/_1036.php Normal file
View file

@ -0,0 +1,16 @@
<?php
namespace Zotlabs\Update;
class _1036 {
function run() {
$r = q("ALTER TABLE `profile` ADD `channels` TEXT NOT NULL AFTER `contact` ");
if($r)
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}
}

30
Zotlabs/Update/_1037.php Normal file
View file

@ -0,0 +1,30 @@
<?php
namespace Zotlabs\Update;
class _1037 {
function run() {
$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;
}
}

17
Zotlabs/Update/_1038.php Normal file
View file

@ -0,0 +1,17 @@
<?php
namespace Zotlabs\Update;
class _1038 {
function run() {
$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;
}
}

16
Zotlabs/Update/_1039.php Normal file
View file

@ -0,0 +1,16 @@
<?php
namespace Zotlabs\Update;
class _1039 {
function run() {
$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;
}
}

16
Zotlabs/Update/_1040.php Normal file
View file

@ -0,0 +1,16 @@
<?php
namespace Zotlabs\Update;
class _1040 {
function run() {
$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;
}
}

16
Zotlabs/Update/_1041.php Normal file
View file

@ -0,0 +1,16 @@
<?php
namespace Zotlabs\Update;
class _1041 {
function run() {
$r = q("ALTER TABLE `outq` ADD `outq_driver` CHAR( 32 ) NOT NULL DEFAULT '' AFTER `outq_channel` ");
if($r)
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}
}

16
Zotlabs/Update/_1042.php Normal file
View file

@ -0,0 +1,16 @@
<?php
namespace Zotlabs\Update;
class _1042 {
function run() {
$r = q("ALTER TABLE `hubloc` ADD `hubloc_updated` DATETIME NOT NULL DEFAULT '0001-01-01 00:00:00',
ADD `hubloc_connected` DATETIME NOT NULL DEFAULT '0001-01-01 00:00:00', ADD INDEX ( `hubloc_updated` ), ADD INDEX ( `hubloc_connected` )");
if($r)
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}
}

15
Zotlabs/Update/_1043.php Normal file
View file

@ -0,0 +1,15 @@
<?php
namespace Zotlabs\Update;
class _1043 {
function run() {
$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;
}
}

15
Zotlabs/Update/_1044.php Normal file
View file

@ -0,0 +1,15 @@
<?php
namespace Zotlabs\Update;
class _1044 {
function run() {
$r = q("ALTER TABLE `term` ADD `imgurl` CHAR( 255 ) NOT NULL ,
ADD INDEX ( `imgurl` ) ");
if($r)
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}
}

15
Zotlabs/Update/_1045.php Normal file
View file

@ -0,0 +1,15 @@
<?php
namespace Zotlabs\Update;
class _1045 {
function run() {
$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;
}
}

15
Zotlabs/Update/_1046.php Normal file
View file

@ -0,0 +1,15 @@
<?php
namespace Zotlabs\Update;
class _1046 {
function run() {
$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;
}
}

15
Zotlabs/Update/_1047.php Normal file
View file

@ -0,0 +1,15 @@
<?php
namespace Zotlabs\Update;
class _1047 {
function run() {
$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;
}
}

29
Zotlabs/Update/_1048.php Normal file
View file

@ -0,0 +1,29 @@
<?php
namespace Zotlabs\Update;
class _1048 {
function run() {
$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;
}
}

15
Zotlabs/Update/_1049.php Normal file
View file

@ -0,0 +1,15 @@
<?php
namespace Zotlabs\Update;
class _1049 {
function run() {
$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;
}
}

15
Zotlabs/Update/_1050.php Normal file
View file

@ -0,0 +1,15 @@
<?php
namespace Zotlabs\Update;
class _1050 {
function run() {
$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;
}
}

16
Zotlabs/Update/_1051.php Normal file
View file

@ -0,0 +1,16 @@
<?php
namespace Zotlabs\Update;
class _1051 {
function run() {
$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;
}
}

14
Zotlabs/Update/_1052.php Normal file
View file

@ -0,0 +1,14 @@
<?php
namespace Zotlabs\Update;
class _1052 {
function run() {
$r = q("ALTER TABLE `channel` ADD UNIQUE (`channel_address`) ");
if($r)
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}
}

14
Zotlabs/Update/_1053.php Normal file
View file

@ -0,0 +1,14 @@
<?php
namespace Zotlabs\Update;
class _1053 {
function run() {
$r = q("ALTER TABLE `profile` ADD `chandesc` TEXT NOT NULL DEFAULT '' AFTER `pdesc` ");
if($r)
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}
}

14
Zotlabs/Update/_1054.php Normal file
View file

@ -0,0 +1,14 @@
<?php
namespace Zotlabs\Update;
class _1054 {
function run() {
$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;
}
}

14
Zotlabs/Update/_1055.php Normal file
View file

@ -0,0 +1,14 @@
<?php
namespace Zotlabs\Update;
class _1055 {
function run() {
$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;
}
}

15
Zotlabs/Update/_1056.php Normal file
View file

@ -0,0 +1,15 @@
<?php
namespace Zotlabs\Update;
class _1056 {
function run() {
$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;
}
}

14
Zotlabs/Update/_1057.php Normal file
View file

@ -0,0 +1,14 @@
<?php
namespace Zotlabs\Update;
class _1057 {
function run() {
$r = q("drop table intro");
if($r)
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}
}

19
Zotlabs/Update/_1058.php Normal file
View file

@ -0,0 +1,19 @@
<?php
namespace Zotlabs\Update;
class _1058 {
function run() {
$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;
}
}

14
Zotlabs/Update/_1059.php Normal file
View file

@ -0,0 +1,14 @@
<?php
namespace Zotlabs\Update;
class _1059 {
function run() {
$r = q("ALTER TABLE `mail` ADD `attach` MEDIUMTEXT NOT NULL DEFAULT '' AFTER `body` ");
if($r)
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}
}

24
Zotlabs/Update/_1060.php Normal file
View file

@ -0,0 +1,24 @@
<?php
namespace Zotlabs\Update;
class _1060 {
function run() {
$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;
}
}

15
Zotlabs/Update/_1061.php Normal file
View file

@ -0,0 +1,15 @@
<?php
namespace Zotlabs\Update;
class _1061 {
function run() {
$r = q("ALTER TABLE `vote` ADD INDEX ( `vote_poll` ), ADD INDEX ( `vote_element` ) ");
if($r)
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}
}

34
Zotlabs/Update/_1062.php Normal file
View file

@ -0,0 +1,34 @@
<?php
namespace Zotlabs\Update;
class _1062 {
function run() {
$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;
}
}

16
Zotlabs/Update/_1063.php Normal file
View file

@ -0,0 +1,16 @@
<?php
namespace Zotlabs\Update;
class _1063 {
function run() {
$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;
}
}

15
Zotlabs/Update/_1064.php Normal file
View file

@ -0,0 +1,15 @@
<?php
namespace Zotlabs\Update;
class _1064 {
function run() {
$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;
}
}

15
Zotlabs/Update/_1065.php Normal file
View file

@ -0,0 +1,15 @@
<?php
namespace Zotlabs\Update;
class _1065 {
function run() {
$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;
}
}

15
Zotlabs/Update/_1066.php Normal file
View file

@ -0,0 +1,15 @@
<?php
namespace Zotlabs\Update;
class _1066 {
function run() {
$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;
}
}

14
Zotlabs/Update/_1067.php Normal file
View file

@ -0,0 +1,14 @@
<?php
namespace Zotlabs\Update;
class _1067 {
function run() {
$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;
}
}

14
Zotlabs/Update/_1068.php Normal file
View file

@ -0,0 +1,14 @@
<?php
namespace Zotlabs\Update;
class _1068 {
function run(){
$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;
}
}

15
Zotlabs/Update/_1069.php Normal file
View file

@ -0,0 +1,15 @@
<?php
namespace Zotlabs\Update;
class _1069 {
function run() {
$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;
}
}

15
Zotlabs/Update/_1070.php Normal file
View file

@ -0,0 +1,15 @@
<?php
namespace Zotlabs\Update;
class _1070 {
function run() {
$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;
}
}

15
Zotlabs/Update/_1071.php Normal file
View file

@ -0,0 +1,15 @@
<?php
namespace Zotlabs\Update;
class _1071 {
function run() {
$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;
}
}

17
Zotlabs/Update/_1072.php Normal file
View file

@ -0,0 +1,17 @@
<?php
namespace Zotlabs\Update;
class _1072 {
function run() {
$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;
}
}

23
Zotlabs/Update/_1073.php Normal file
View file

@ -0,0 +1,23 @@
<?php
namespace Zotlabs\Update;
class _1073 {
function run() {
$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;
}
}

19
Zotlabs/Update/_1074.php Normal file
View file

@ -0,0 +1,19 @@
<?php
namespace Zotlabs\Update;
class _1074 {
function run() {
$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 '0001-01-01 00:00:00' AFTER `ud_date` ,
ADD INDEX ( `ud_last` ) ");
if($r1 && $r2)
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}
}

16
Zotlabs/Update/_1075.php Normal file
View file

@ -0,0 +1,16 @@
<?php
namespace Zotlabs\Update;
class _1075 {
function run() {
$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;
}
}

14
Zotlabs/Update/_1076.php Normal file
View file

@ -0,0 +1,14 @@
<?php
namespace Zotlabs\Update;
class _1076 {
function run() {
$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;
}
}

14
Zotlabs/Update/_1077.php Normal file
View file

@ -0,0 +1,14 @@
<?php
namespace Zotlabs\Update;
class _1077 {
function run() {
$r = q("ALTER TABLE `item` ADD `source_xchan` CHAR( 255 ) NOT NULL DEFAULT '' AFTER `author_xchan` ");
if($r)
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}
}

15
Zotlabs/Update/_1078.php Normal file
View file

@ -0,0 +1,15 @@
<?php
namespace Zotlabs\Update;
class _1078 {
function run() {
$r = q("ALTER TABLE `channel` ADD `channel_dirdate` DATETIME NOT NULL DEFAULT '0001-01-01 00:00:00' AFTER `channel_pageflags` , ADD INDEX ( `channel_dirdate` )");
if($r)
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}
}

14
Zotlabs/Update/_1079.php Normal file
View file

@ -0,0 +1,14 @@
<?php
namespace Zotlabs\Update;
class _1079 {
function run() {
$r = q("ALTER TABLE `site` ADD `site_location` CHAR( 255 ) NOT NULL DEFAULT ''");
if($r)
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}
}

15
Zotlabs/Update/_1080.php Normal file
View file

@ -0,0 +1,15 @@
<?php
namespace Zotlabs\Update;
class _1080 {
function run() {
$r = q("ALTER TABLE `mail` ADD `expires` DATETIME NOT NULL DEFAULT '0001-01-01 00:00:00',
ADD INDEX ( `expires` ) ");
if($r)
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}
}

14
Zotlabs/Update/_1081.php Normal file
View file

@ -0,0 +1,14 @@
<?php
namespace Zotlabs\Update;
class _1081 {
function run() {
$r = q("DROP TABLE `queue` ");
if($r)
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}
}

14
Zotlabs/Update/_1082.php Normal file
View file

@ -0,0 +1,14 @@
<?php
namespace Zotlabs\Update;
class _1082 {
function run() {
$r = q("DROP TABLE `challenge` ");
if($r)
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}
}

15
Zotlabs/Update/_1083.php Normal file
View file

@ -0,0 +1,15 @@
<?php
namespace Zotlabs\Update;
class _1083 {
function run() {
$r = q("ALTER TABLE `notify` ADD `aid` INT NOT NULL AFTER `msg` ,
ADD INDEX ( `aid` )");
if($r)
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}
}

24
Zotlabs/Update/_1084.php Normal file
View file

@ -0,0 +1,24 @@
<?php
namespace Zotlabs\Update;
class _1084 {
function run() {
$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;
}
}

20
Zotlabs/Update/_1085.php Normal file
View file

@ -0,0 +1,20 @@
<?php
namespace Zotlabs\Update;
class _1085 {
function run() {
$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;
}
}

15
Zotlabs/Update/_1086.php Normal file
View file

@ -0,0 +1,15 @@
<?php
namespace Zotlabs\Update;
class _1086 {
function run() {
$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;
}
}

17
Zotlabs/Update/_1087.php Normal file
View file

@ -0,0 +1,17 @@
<?php
namespace Zotlabs\Update;
class _1087 {
function run() {
$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;
}
}

17
Zotlabs/Update/_1088.php Normal file
View file

@ -0,0 +1,17 @@
<?php
namespace Zotlabs\Update;
class _1088 {
function run() {
$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;
}
}

16
Zotlabs/Update/_1089.php Normal file
View file

@ -0,0 +1,16 @@
<?php
namespace Zotlabs\Update;
class _1089 {
function run() {
$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;
}
}

15
Zotlabs/Update/_1090.php Normal file
View file

@ -0,0 +1,15 @@
<?php
namespace Zotlabs\Update;
class _1090 {
function run() {
$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;
}
}

13
Zotlabs/Update/_1091.php Normal file
View file

@ -0,0 +1,13 @@
<?php
namespace Zotlabs\Update;
class _1091 {
function run() {
@os_mkdir('store/[data]/smarty3',STORAGE_DEFAULT_PERMISSIONS,true);
@file_put_contents('store/[data]/locks','');
return UPDATE_SUCCESS;
}
}

61
Zotlabs/Update/_1092.php Normal file
View file

@ -0,0 +1,61 @@
<?php
namespace Zotlabs\Update;
class _1092 {
function run() {
$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 '0001-01-01 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 '0001-01-01 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 '0001-01-01 00:00:00',
`cr_edited` datetime NOT NULL DEFAULT '0001-01-01 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;
}
}

14
Zotlabs/Update/_1093.php Normal file
View file

@ -0,0 +1,14 @@
<?php
namespace Zotlabs\Update;
class _1093 {
function run() {
$r = q("ALTER TABLE `chatpresence` ADD `cp_client` CHAR( 128 ) NOT NULL DEFAULT ''");
if($r)
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}
}

Some files were not shown because too many files have changed in this diff Show more