aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Update/_1204.php
diff options
context:
space:
mode:
authormrjive <mrjive@mrjive.it>2018-03-13 10:59:21 +0100
committerGitHub <noreply@github.com>2018-03-13 10:59:21 +0100
commit790660e61264ed884a8c600f407cf75893ffe977 (patch)
tree8fb3e4263cd7cdf4b34e0d7bb859c2f290c8ab39 /Zotlabs/Update/_1204.php
parent2bcfa0c12687d47c11e8c445a5a38ffe96d5c135 (diff)
parent53c1d3775cc140ecda50d837752adac851d9e0b2 (diff)
downloadvolse-hubzilla-790660e61264ed884a8c600f407cf75893ffe977.tar.gz
volse-hubzilla-790660e61264ed884a8c600f407cf75893ffe977.tar.bz2
volse-hubzilla-790660e61264ed884a8c600f407cf75893ffe977.zip
Merge pull request #18 from redmatrix/dev
Dev
Diffstat (limited to 'Zotlabs/Update/_1204.php')
-rw-r--r--Zotlabs/Update/_1204.php34
1 files changed, 34 insertions, 0 deletions
diff --git a/Zotlabs/Update/_1204.php b/Zotlabs/Update/_1204.php
new file mode 100644
index 000000000..0b9204b9b
--- /dev/null
+++ b/Zotlabs/Update/_1204.php
@@ -0,0 +1,34 @@
+<?php
+
+namespace Zotlabs\Update;
+
+class _1204 {
+
+ function run() {
+
+ if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) {
+ $r1 = q("ALTER TABLE poll ADD poll_guid text NOT NULL");
+ $r2 = q("create index \"poll_guid_idx\" on poll (\"poll_guid\")");
+ $r3 = q("ALTER TABLE poll_elm ADD pelm_guid text NOT NULL");
+ $r4 = q("create index \"pelm_guid_idx\" on poll_elm (\"pelm_guid\")");
+ $r5 = q("ALTER TABLE vote ADD vote_guid text NOT NULL");
+ $r6 = q("create index \"vote_guid_idx\" on vote (\"vote_guid\")");
+
+ $r = ($r1 && $r2 && $r3 && $r4 && $r5 && $r6);
+ }
+ else {
+ $r1 = q("ALTER TABLE `poll` ADD `poll_guid` VARCHAR(191) NOT NULL, ADD INDEX `poll_guid` (`poll_guid`) ");
+ $r2 = q("ALTER TABLE `poll_elm` ADD `pelm_guid` VARCHAR(191) NOT NULL, ADD INDEX `pelm_guid` (`pelm_guid`) ");
+ $r3 = q("ALTER TABLE `vote` ADD `vote_guid` VARCHAR(191) NOT NULL, ADD INDEX `vote_guid` (`vote_guid`) ");
+
+ $r = ($r1 && $r2 && $r3);
+ }
+
+ if($r)
+ return UPDATE_SUCCESS;
+
+ return UPDATE_FAILED;
+
+ }
+
+}