diff options
author | Andrew Manning <tamanning@zoho.com> | 2018-03-10 15:10:09 -0500 |
---|---|---|
committer | Andrew Manning <tamanning@zoho.com> | 2018-03-10 15:10:09 -0500 |
commit | a4de63ca923583b77cf2a4ad60f4893e006f90e4 (patch) | |
tree | 31406e7dffabc54d2b49879272598236949793c7 /Zotlabs/Update | |
parent | 9b13db1c4896e6a8b0a55195530f5449999e811d (diff) | |
parent | 78040330b6be3681dd0d6fdd1d3d0960fd88bc06 (diff) | |
download | volse-hubzilla-a4de63ca923583b77cf2a4ad60f4893e006f90e4.tar.gz volse-hubzilla-a4de63ca923583b77cf2a4ad60f4893e006f90e4.tar.bz2 volse-hubzilla-a4de63ca923583b77cf2a4ad60f4893e006f90e4.zip |
Merge branch 'dev' into oauth2
Diffstat (limited to 'Zotlabs/Update')
-rw-r--r-- | Zotlabs/Update/_1204.php | 6 | ||||
-rw-r--r-- | Zotlabs/Update/_1208.php | 26 | ||||
-rw-r--r-- | Zotlabs/Update/_1209.php | 26 |
3 files changed, 55 insertions, 3 deletions
diff --git a/Zotlabs/Update/_1204.php b/Zotlabs/Update/_1204.php index 93c2e4e3f..0b9204b9b 100644 --- a/Zotlabs/Update/_1204.php +++ b/Zotlabs/Update/_1204.php @@ -8,11 +8,11 @@ class _1204 { 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\""); + $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\""); + $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\""); + $r6 = q("create index \"vote_guid_idx\" on vote (\"vote_guid\")"); $r = ($r1 && $r2 && $r3 && $r4 && $r5 && $r6); } diff --git a/Zotlabs/Update/_1208.php b/Zotlabs/Update/_1208.php new file mode 100644 index 000000000..4cbcf4322 --- /dev/null +++ b/Zotlabs/Update/_1208.php @@ -0,0 +1,26 @@ +<?php + +namespace Zotlabs\Update; + +class _1208 { + + function run() { + + if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) { + $r1 = q("ALTER TABLE poll ADD poll_author text NOT NULL"); + $r2 = q("create index \"poll_author_idx\" on poll \"poll_author\""); + + $r = ($r1 && $r2); + } + else { + $r = q("ALTER TABLE `poll` ADD `poll_author` VARCHAR(191) NOT NULL AFTER `poll_votes`, + ADD INDEX `poll_author` (`poll_author`)"); + } + + if($r) + return UPDATE_SUCCESS; + return UPDATE_FAILED; + + } + +} 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; + + } + +} |