diff options
author | Mario Vavti <mario@mariovavti.com> | 2018-10-19 11:18:28 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2018-10-19 11:18:28 +0200 |
commit | fa9e9510e5d993d183feb942fe74be5fdd07f5cf (patch) | |
tree | 41fec09f527a9346e043b8099b458a97d81b03ed /Zotlabs/Update | |
parent | 32de123db0ac526795a237ff46885fe8a332cbc0 (diff) | |
parent | 06b3ad1071c755757555baf941e2c0f446f97b21 (diff) | |
download | volse-hubzilla-fa9e9510e5d993d183feb942fe74be5fdd07f5cf.tar.gz volse-hubzilla-fa9e9510e5d993d183feb942fe74be5fdd07f5cf.tar.bz2 volse-hubzilla-fa9e9510e5d993d183feb942fe74be5fdd07f5cf.zip |
Merge branch '3.8RC'3.8
Diffstat (limited to 'Zotlabs/Update')
-rw-r--r-- | Zotlabs/Update/_1217.php | 22 | ||||
-rw-r--r-- | Zotlabs/Update/_1218.php | 31 | ||||
-rw-r--r-- | Zotlabs/Update/_1219.php | 26 | ||||
-rw-r--r-- | Zotlabs/Update/_1220.php | 47 | ||||
-rw-r--r-- | Zotlabs/Update/_1221.php | 25 | ||||
-rw-r--r-- | Zotlabs/Update/_1222.php | 23 | ||||
-rw-r--r-- | Zotlabs/Update/_1223.php | 23 | ||||
-rw-r--r-- | Zotlabs/Update/_1224.php | 28 |
8 files changed, 225 insertions, 0 deletions
diff --git a/Zotlabs/Update/_1217.php b/Zotlabs/Update/_1217.php new file mode 100644 index 000000000..15d2d06b3 --- /dev/null +++ b/Zotlabs/Update/_1217.php @@ -0,0 +1,22 @@ +<?php + +namespace Zotlabs\Update; + +class _1217 { + + function run() { + if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) { + $r = q("ALTER TABLE app ADD app_options smallint NOT NULL DEFAULT '0' "); + } + else { + $r = q("ALTER TABLE app ADD app_options int(11) NOT NULL DEFAULT 0 "); + + } + + if($r) { + return UPDATE_SUCCESS; + } + return UPDATE_FAILED; + } +} + diff --git a/Zotlabs/Update/_1218.php b/Zotlabs/Update/_1218.php new file mode 100644 index 000000000..07c7dba20 --- /dev/null +++ b/Zotlabs/Update/_1218.php @@ -0,0 +1,31 @@ +<?php + +namespace Zotlabs\Update; + +class _1218 { + + function run() { + + if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) { + $r1 = q("ALTER TABLE hubloc add hubloc_id_url text NOT NULL DEFAULT ''"); + $r2 = q("create index \"hubloc_id_url\" on hubloc (\"hubloc_id_url\")"); + $r3 = q("ALTER TABLE hubloc add hubloc_site_id text NOT NULL DEFAULT ''"); + $r4 = q("create index \"hubloc_site_id\" on hubloc (\"hubloc_site_id\")"); + + $r = $r1 && $r2 && $r3 && $r4; + } + + if(ACTIVE_DBTYPE == DBTYPE_MYSQL) { + $r1 = q("ALTER TABLE hubloc add hubloc_id_url varchar(191) NOT NULL, ADD INDEX hubloc_id_url (hubloc_id_url)"); + $r2 = q("ALTER TABLE hubloc add hubloc_site_id varchar(191) NOT NULL, ADD INDEX hubloc_site_id (hubloc_site_id)"); + + $r = $r1 && $r2; + } + + if($r) + return UPDATE_SUCCESS; + return UPDATE_FAILED; + + } + +} diff --git a/Zotlabs/Update/_1219.php b/Zotlabs/Update/_1219.php new file mode 100644 index 000000000..be2534001 --- /dev/null +++ b/Zotlabs/Update/_1219.php @@ -0,0 +1,26 @@ +<?php + +namespace Zotlabs\Update; + +class _1219 { + + function run() { + q("START TRANSACTION"); + + $r = q("DELETE FROM xchan WHERE + xchan_hash like '%s' AND + xchan_network = 'activitypub'", + dbesc(z_root()) . '%' + ); + + if($r) { + q("COMMIT"); + return UPDATE_SUCCESS; + } + else { + q("ROLLBACK"); + return UPDATE_FAILED; + } + } + +} diff --git a/Zotlabs/Update/_1220.php b/Zotlabs/Update/_1220.php new file mode 100644 index 000000000..6ce09c16b --- /dev/null +++ b/Zotlabs/Update/_1220.php @@ -0,0 +1,47 @@ +<?php + +namespace Zotlabs\Update; + +class _1220 { + + function run() { + + if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) { + $r1 = q("CREATE TABLE listeners ( + id serial NOT NULL, + target_id text NOT NULL, + portable_id text NOT NULL, + ltype smallint NOT NULL DEFAULT '0', + PRIMARY KEY (id) +)"); + + $r2 = q("create index \"target_id_idx\" on listeners (\"target_id\")"); + $r3 = q("create index \"portable_id_idx\" on listeners (\"portable_id\")"); + $r4 = q("create index \"ltype_idx\" on listeners (\"ltype\")"); + + $r = $r1 && $r2 && $r3 && $r4; + + } + + if(ACTIVE_DBTYPE == DBTYPE_MYSQL) { + $r = q("CREATE TABLE IF NOT EXISTS listeners ( + id int(11) NOT NULL AUTO_INCREMENT, + target_id varchar(191) NOT NULL DEFAULT '', + portable_id varchar(191) NOT NULL DEFAULT '', + ltype int(11) NOT NULL DEFAULT 0, + PRIMARY KEY (id), + KEY target_id (target_id), + KEY portable_id (portable_id), + KEY ltype (ltype) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4"); + + } + + if($r) { + return UPDATE_SUCCESS; + } + return UPDATE_FAILED; + + } + +} diff --git a/Zotlabs/Update/_1221.php b/Zotlabs/Update/_1221.php new file mode 100644 index 000000000..75b400adc --- /dev/null +++ b/Zotlabs/Update/_1221.php @@ -0,0 +1,25 @@ +<?php + +namespace Zotlabs\Update; + +class _1221 { + + function run() { + + q("START TRANSACTION"); + + $r1 = q("ALTER table " . TQUOT . 'groups' . TQUOT . " rename to pgrp "); + $r2 = q("ALTER table " . TQUOT . 'group_member' . TQUOT . " rename to pgrp_member "); + + + if($r1 && $r2) { + q("COMMIT"); + return UPDATE_SUCCESS; + } + + q("ROLLBACK"); + return UPDATE_FAILED; + + } + +} diff --git a/Zotlabs/Update/_1222.php b/Zotlabs/Update/_1222.php new file mode 100644 index 000000000..ad8d03197 --- /dev/null +++ b/Zotlabs/Update/_1222.php @@ -0,0 +1,23 @@ +<?php + +namespace Zotlabs\Update; + +class _1222 { + + function run() { + + q("START TRANSACTION"); + + $r1 = q("DELETE FROM app WHERE app_name = 'Grid' and app_system = 1"); + + if($r1) { + q("COMMIT"); + return UPDATE_SUCCESS; + } + + q("ROLLBACK"); + return UPDATE_FAILED; + + } + +} diff --git a/Zotlabs/Update/_1223.php b/Zotlabs/Update/_1223.php new file mode 100644 index 000000000..c6f05c806 --- /dev/null +++ b/Zotlabs/Update/_1223.php @@ -0,0 +1,23 @@ +<?php + +namespace Zotlabs\Update; + +class _1223 { + + function run() { + + q("START TRANSACTION"); + + $r1 = q("DELETE FROM app WHERE app_name = 'View Bookmarks' and app_system = 1"); + + if($r1) { + q("COMMIT"); + return UPDATE_SUCCESS; + } + + q("ROLLBACK"); + return UPDATE_FAILED; + + } + +} diff --git a/Zotlabs/Update/_1224.php b/Zotlabs/Update/_1224.php new file mode 100644 index 000000000..d160cea5d --- /dev/null +++ b/Zotlabs/Update/_1224.php @@ -0,0 +1,28 @@ +<?php + +namespace Zotlabs\Update; + +class _1224 { + + function run() { + if(ACTIVE_DBTYPE == DBTYPE_MYSQL) { + q("START TRANSACTION"); + + $r1 = q("ALTER TABLE hubloc ALTER hubloc_id_url SET DEFAULT ''"); + $r2 = q("ALTER TABLE hubloc ALTER hubloc_site_id SET DEFAULT ''"); + + if($r1 && $r2) { + q("COMMIT"); + return UPDATE_SUCCESS; + } + + q("ROLLBACK"); + return UPDATE_FAILED; + } + if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) { + return UPDATE_SUCCESS; + } + + } + +} |