fix issue #1281 - hubloc default values

This commit is contained in:
Mario Vavti 2018-10-06 23:05:45 +02:00
parent 65dcb39bac
commit dd3ec468f6
3 changed files with 27 additions and 2 deletions

25
Zotlabs/Update/_1224.php Normal file
View File

@ -0,0 +1,25 @@
<?php
namespace Zotlabs\Update;
class _1224 {
function run() {
q("START TRANSACTION");
if(ACTIVE_DBTYPE == DBTYPE_MYSQL) {
$r1 = q("ALTER TABLE hubloc ALTER hubloc_id_url SET DEFAULT ''");
$r2 = q("ALTER TABLE hubloc ALTER hubloc_site_id SET DEFAULT ''");
}
if($r1 && $r2) {
q("COMMIT");
return UPDATE_SUCCESS;
}
q("ROLLBACK");
return UPDATE_FAILED;
}
}

View File

@ -54,7 +54,7 @@ define ( 'STD_VERSION', '3.9' );
define ( 'ZOT_REVISION', '6.0a' ); define ( 'ZOT_REVISION', '6.0a' );
define ( 'DB_UPDATE_VERSION', 1223 ); define ( 'DB_UPDATE_VERSION', 1224 );
define ( 'PROJECT_BASE', __DIR__ ); define ( 'PROJECT_BASE', __DIR__ );

View File

@ -505,7 +505,7 @@ CREATE TABLE IF NOT EXISTS `hubloc` (
`hubloc_id` int(10) unsigned NOT NULL AUTO_INCREMENT, `hubloc_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`hubloc_guid` char(191) NOT NULL DEFAULT '', `hubloc_guid` char(191) NOT NULL DEFAULT '',
`hubloc_guid_sig` text NOT NULL, `hubloc_guid_sig` text NOT NULL,
`hubloc_id_url` char(191) NOT NULL DEFAULT '0', `hubloc_id_url` char(191) NOT NULL DEFAULT '',
`hubloc_hash` char(191) NOT NULL DEFAULT '', `hubloc_hash` char(191) NOT NULL DEFAULT '',
`hubloc_addr` char(191) NOT NULL DEFAULT '', `hubloc_addr` char(191) NOT NULL DEFAULT '',
`hubloc_network` char(32) NOT NULL DEFAULT '', `hubloc_network` char(32) NOT NULL DEFAULT '',