aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Update/_1209.php
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2018-03-07 15:39:14 -0800
committerzotlabs <mike@macgirvin.com>2018-03-07 15:39:14 -0800
commita454aad124f999e59e8bffb625c103b975aef107 (patch)
tree175ca8a9feffee0944de0784e093154291438e82 /Zotlabs/Update/_1209.php
parentf0f58dade886d88fc178b78c04e1a4067ddfda04 (diff)
downloadvolse-hubzilla-a454aad124f999e59e8bffb625c103b975aef107.tar.gz
volse-hubzilla-a454aad124f999e59e8bffb625c103b975aef107.tar.bz2
volse-hubzilla-a454aad124f999e59e8bffb625c103b975aef107.zip
federated polls: GNU-Social requires us to preserve the original order of the poll answers for use in making a vote, unlike diaspora (which selects by guid) and activitypub (which selects by non-localisable text).
Diffstat (limited to 'Zotlabs/Update/_1209.php')
-rw-r--r--Zotlabs/Update/_1209.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/Zotlabs/Update/_1209.php b/Zotlabs/Update/_1209.php
new file mode 100644
index 000000000..5ec449395
--- /dev/null
+++ b/Zotlabs/Update/_1209.php
@@ -0,0 +1,26 @@
+<?php
+
+namespace Zotlabs\Update;
+
+class _1209 {
+
+ function run() {
+
+ if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) {
+ $r1 = q("ALTER TABLE poll_elm ADD pelm_order numeric(6) NOT NULL DEFAULT '0' ");
+ $r2 = q("create index \"pelm_order_idx\" on poll_elm \"pelm_order\"");
+
+ $r = ($r1 && $r2);
+ }
+ else {
+ $r = q("ALTER TABLE `poll_elm` ADD `pelm_order` int(11) NOT NULL DEFAULT 0,
+ ADD INDEX `pelm_order` (`pelm_order`)");
+ }
+
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+
+ }
+
+}