aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Update
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2023-04-26 17:58:35 +0200
committerMario Vavti <mario@mariovavti.com>2023-04-26 17:58:35 +0200
commitd79290df75b214f50f0d9ec586a7b855e3a86106 (patch)
treec104db7bfdf8559dbda48ddc3f0b0b291735a662 /Zotlabs/Update
parent0bf65bcad5f11be5b8d8e3280fc2f96f150a8830 (diff)
downloadvolse-hubzilla-d79290df75b214f50f0d9ec586a7b855e3a86106.tar.gz
volse-hubzilla-d79290df75b214f50f0d9ec586a7b855e3a86106.tar.bz2
volse-hubzilla-d79290df75b214f50f0d9ec586a7b855e3a86106.zip
dirsync update column
Diffstat (limited to 'Zotlabs/Update')
-rw-r--r--Zotlabs/Update/_1256.php36
1 files changed, 36 insertions, 0 deletions
diff --git a/Zotlabs/Update/_1256.php b/Zotlabs/Update/_1256.php
new file mode 100644
index 000000000..db9537117
--- /dev/null
+++ b/Zotlabs/Update/_1256.php
@@ -0,0 +1,36 @@
+<?php
+
+namespace Zotlabs\Update;
+
+class _1256 {
+
+ function run() {
+
+ dbq("START TRANSACTION");
+
+ $r1 = dbq("TRUNCATE TABLE updates");
+
+ if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) {
+ $r2a = dbq("ALTER TABLE updates add ud_update numeric(1) NOT NULL DEFAULT '0'");
+ $r2b = dbq("CREATE INDEX ud_update ON updates (ud_update)");
+
+ $r2 = ($r2a && $r2b);
+ }
+
+ if(ACTIVE_DBTYPE == DBTYPE_MYSQL) {
+ $r2 = dbq("ALTER TABLE updates add ud_update tinyint(1) NOT NULL DEFAULT '',
+ KEY ud_update (ud_update)"
+ );
+ }
+
+ if($r1 && $r2) {
+ dbq("COMMIT");
+ return UPDATE_SUCCESS;
+ }
+
+ q("ROLLBACK");
+ return UPDATE_FAILED;
+
+ }
+
+}