update 1257 ud_guid > ud_host

This commit is contained in:
Mario
2023-04-26 16:28:20 +00:00
parent 0faab9277f
commit 60f0739c3e
2 changed files with 34 additions and 1 deletions

33
Zotlabs/Update/_1257.php Normal file
View File

@@ -0,0 +1,33 @@
<?php
namespace Zotlabs\Update;
class _1257 {
function run() {
dbq("START TRANSACTION");
$r1 = dbq("TRUNCATE TABLE updates");
if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) {
$r2 = dbq("ALTER TABLE updates add ud_host text NOT NULL DEFAULT ''");
}
if(ACTIVE_DBTYPE == DBTYPE_MYSQL) {
$r2 = dbq("ALTER TABLE updates add ud_host varchar(191) NOT NULL DEFAULT ''");
}
$r3 = dbq("ALTER TABLE updates DROP COLUMN ud_guid");
if($r1 && $r2 && $r3) {
dbq("COMMIT");
return UPDATE_SUCCESS;
}
q("ROLLBACK");
return UPDATE_FAILED;
}
}

View File

@@ -63,7 +63,7 @@ define('PLATFORM_NAME', 'hubzilla');
define('STD_VERSION', '8.3.5');
define('ZOT_REVISION', '6.0');
define('DB_UPDATE_VERSION', 1256);
define('DB_UPDATE_VERSION', 1257);
define('PROJECT_BASE', __DIR__);