aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Update
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs/Update')
-rw-r--r--Zotlabs/Update/_1204.php34
-rw-r--r--Zotlabs/Update/_1205.php38
-rw-r--r--Zotlabs/Update/_1206.php24
-rw-r--r--Zotlabs/Update/_1207.php24
-rw-r--r--Zotlabs/Update/_1208.php26
-rw-r--r--Zotlabs/Update/_1209.php26
6 files changed, 172 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;
+
+ }
+
+}
diff --git a/Zotlabs/Update/_1205.php b/Zotlabs/Update/_1205.php
new file mode 100644
index 000000000..968833726
--- /dev/null
+++ b/Zotlabs/Update/_1205.php
@@ -0,0 +1,38 @@
+<?php
+
+namespace Zotlabs\Update;
+
+class _1205 {
+
+ function run() {
+
+ if(ACTIVE_DBTYPE == DBTYPE_MYSQL) {
+
+ q("ALTER TABLE item DROP INDEX title");
+ q("ALTER TABLE item DROP INDEX body");
+ q("ALTER TABLE item DROP INDEX allow_cid");
+ q("ALTER TABLE item DROP INDEX allow_gid");
+ q("ALTER TABLE item DROP INDEX deny_cid");
+ q("ALTER TABLE item DROP INDEX deny_gid");
+ q("ALTER TABLE item DROP INDEX item_flags");
+ q("ALTER TABLE item DROP INDEX item_restrict");
+ q("ALTER TABLE item DROP INDEX aid");
+
+ $r = q("ALTER TABLE item
+ DROP INDEX item_private,
+ ADD INDEX uid_item_private (uid, item_private),
+ ADD INDEX item_wall (item_wall),
+ ADD INDEX item_pending_remove_changed (item_pending_remove, changed)
+ ");
+
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+ }
+ else {
+ return UPDATE_SUCCESS;
+ }
+
+ }
+
+}
diff --git a/Zotlabs/Update/_1206.php b/Zotlabs/Update/_1206.php
new file mode 100644
index 000000000..351d53ff6
--- /dev/null
+++ b/Zotlabs/Update/_1206.php
@@ -0,0 +1,24 @@
+<?php
+
+namespace Zotlabs\Update;
+
+class _1206 {
+
+ function run() {
+
+ if(ACTIVE_DBTYPE == DBTYPE_MYSQL) {
+ $r = q("ALTER TABLE item
+ ADD INDEX uid_resource_type (uid, resource_type)
+ ");
+
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+ }
+ else {
+ return UPDATE_SUCCESS;
+ }
+
+ }
+
+}
diff --git a/Zotlabs/Update/_1207.php b/Zotlabs/Update/_1207.php
new file mode 100644
index 000000000..f53bc46ae
--- /dev/null
+++ b/Zotlabs/Update/_1207.php
@@ -0,0 +1,24 @@
+<?php
+
+namespace Zotlabs\Update;
+
+class _1207 {
+
+ function run() {
+
+ if(ACTIVE_DBTYPE == DBTYPE_MYSQL) {
+ $r = q("ALTER TABLE item
+ DROP INDEX resource_type
+ ");
+
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+ }
+ else {
+ return UPDATE_SUCCESS;
+ }
+
+ }
+
+}
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;
+
+ }
+
+}