aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2023-04-26 16:28:20 +0000
committerMario <mario@mariovavti.com>2023-04-26 16:28:20 +0000
commit60f0739c3e8158bdcb373c3607ef2e8e8fcb4e08 (patch)
treec9a46b7766cc9c22c4321e6602cd2ca64011fc22
parent0faab9277fbeb7a37bef63deef799bbd8e93706c (diff)
downloadvolse-hubzilla-60f0739c3e8158bdcb373c3607ef2e8e8fcb4e08.tar.gz
volse-hubzilla-60f0739c3e8158bdcb373c3607ef2e8e8fcb4e08.tar.bz2
volse-hubzilla-60f0739c3e8158bdcb373c3607ef2e8e8fcb4e08.zip
update 1257 ud_guid > ud_host
-rw-r--r--Zotlabs/Update/_1257.php33
-rw-r--r--boot.php2
2 files changed, 34 insertions, 1 deletions
diff --git a/Zotlabs/Update/_1257.php b/Zotlabs/Update/_1257.php
new file mode 100644
index 000000000..34c10c372
--- /dev/null
+++ b/Zotlabs/Update/_1257.php
@@ -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;
+
+ }
+
+}
diff --git a/boot.php b/boot.php
index 3d6dd53e4..1f9d131d3 100644
--- a/boot.php
+++ b/boot.php
@@ -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__);