aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Update/_1254.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2022-12-02 19:22:19 +0000
committerMario <mario@mariovavti.com>2022-12-02 19:22:19 +0000
commit2bb58843ab303ba3e1a4a2c0c5a64138852ebbe0 (patch)
tree1e85f560122aae0b30dfe5a55c3de90fbce64ed1 /Zotlabs/Update/_1254.php
parentd16b6c3838cd76eb7ce336444cbd37774857b64f (diff)
downloadvolse-hubzilla-2bb58843ab303ba3e1a4a2c0c5a64138852ebbe0.tar.gz
volse-hubzilla-2bb58843ab303ba3e1a4a2c0c5a64138852ebbe0.tar.bz2
volse-hubzilla-2bb58843ab303ba3e1a4a2c0c5a64138852ebbe0.zip
move queueworker to core and bump version
Diffstat (limited to 'Zotlabs/Update/_1254.php')
-rw-r--r--Zotlabs/Update/_1254.php55
1 files changed, 55 insertions, 0 deletions
diff --git a/Zotlabs/Update/_1254.php b/Zotlabs/Update/_1254.php
new file mode 100644
index 000000000..ec54754c0
--- /dev/null
+++ b/Zotlabs/Update/_1254.php
@@ -0,0 +1,55 @@
+<?php
+
+namespace Zotlabs\Update;
+
+class _1254 {
+
+ function run() {
+
+ dbq("START TRANSACTION");
+
+ if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) {
+ $r1 = dbq("CREATE TABLE IF NOT EXISTS workerq (
+ workerq_id bigserial NOT NULL,
+ workerq_priority smallint,
+ workerq_reservationid varchar(25) DEFAULT NULL,
+ workerq_processtimeout timestamp NOT NULL DEFAULT '0001-01-01 00:00:00',
+ workerq_data text,
+ workerq_uuid UUID NOT NULL,
+ PRIMARY KEY (workerq_id))"
+ );
+
+ $r2 = dbq("CREATE INDEX idx_workerq_priority ON workerq (workerq_priority)");
+ $r3 = dbq("CREATE INDEX idx_workerq_reservationid ON workerq (workerq_reservationid)");
+ $r4 = dbq("CREATE INDEX idx_workerq_processtimeout ON workerq (workerq_processtimeout)");
+ $r5 = dbq("CREATE INDEX idx_workerq_uuid ON workerq (workerq_uuid)")
+
+ $r = ($r1 && $r2 && $r3 && $r4 && $r5);
+ }
+ else {
+ $r = dbq("CREATE TABLE IF NOT EXISTS workerq (
+ workerq_id BIGINT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
+ workerq_priority smallint,
+ workerq_reservationid varchar(25) DEFAULT NULL,
+ workerq_processtimeout datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
+ workerq_data text,
+ workerq_uuid char(36) NOT NULL DEFAULT ''
+ KEY workerq_priority (workerq_priority),
+ KEY workerq_reservationid (workerq_reservationid),
+ KEY workerq_processtimeout (workerq_uuid)
+ KEY workerq_uuid` (workerq_processtimeout)
+ ) ENGINE = InnoDB DEFAULT CHARSET=utf8mb4"
+ );
+ }
+
+ if($r) {
+ dbq("COMMIT");
+ return UPDATE_SUCCESS;
+ }
+
+ q("ROLLBACK");
+ return UPDATE_FAILED;
+
+ }
+
+}