diff options
Diffstat (limited to 'Zotlabs/Update')
-rw-r--r-- | Zotlabs/Update/_1246.php | 24 | ||||
-rw-r--r-- | Zotlabs/Update/_1247.php | 23 | ||||
-rw-r--r-- | Zotlabs/Update/_1248.php | 27 | ||||
-rw-r--r-- | Zotlabs/Update/_1249.php | 31 | ||||
-rw-r--r-- | Zotlabs/Update/_1250.php | 31 | ||||
-rw-r--r-- | Zotlabs/Update/_1251.php | 23 | ||||
-rw-r--r-- | Zotlabs/Update/_1252.php | 23 |
7 files changed, 182 insertions, 0 deletions
diff --git a/Zotlabs/Update/_1246.php b/Zotlabs/Update/_1246.php new file mode 100644 index 000000000..3023c45dd --- /dev/null +++ b/Zotlabs/Update/_1246.php @@ -0,0 +1,24 @@ +<?php + +namespace Zotlabs\Update; + +class _1246 { + + function run() { + + q("START TRANSACTION"); + + $r1 = dbq("UPDATE xchan SET xchan_deleted = 2 WHERE xchan_network = 'zot' AND xchan_deleted = 0"); + $r2 = dbq("UPDATE hubloc SET hubloc_deleted = 2 WHERE hubloc_network = 'zot' AND hubloc_deleted = 0"); + + if($r1 && $r2) { + q("COMMIT"); + return UPDATE_SUCCESS; + } + + q("ROLLBACK"); + return UPDATE_FAILED; + + } + +} diff --git a/Zotlabs/Update/_1247.php b/Zotlabs/Update/_1247.php new file mode 100644 index 000000000..e776a52f4 --- /dev/null +++ b/Zotlabs/Update/_1247.php @@ -0,0 +1,23 @@ +<?php + +namespace Zotlabs\Update; + +class _1247 { + + function run() { + + q("START TRANSACTION"); + + $r = dbq("DELETE FROM updates WHERE ud_addr = '' OR ud_hash = '' OR ud_guid = ''"); + + if($r) { + q("COMMIT"); + return UPDATE_SUCCESS; + } + + q("ROLLBACK"); + return UPDATE_FAILED; + + } + +} diff --git a/Zotlabs/Update/_1248.php b/Zotlabs/Update/_1248.php new file mode 100644 index 000000000..b61c6ed39 --- /dev/null +++ b/Zotlabs/Update/_1248.php @@ -0,0 +1,27 @@ +<?php + +namespace Zotlabs\Update; + +class _1248 { + + function run() { + + q("START TRANSACTION"); + + // remove possible bogus entries from xconfig + $r = dbq("DELETE FROM xconfig WHERE xchan = ''"); + + // remove gnu social app - it has been moved to addons unmaintained + $r1 = dbq("DELETE FROM app WHERE app_plugin = 'gnusoc'"); + + if($r && $r1) { + q("COMMIT"); + return UPDATE_SUCCESS; + } + + q("ROLLBACK"); + return UPDATE_FAILED; + + } + +} diff --git a/Zotlabs/Update/_1249.php b/Zotlabs/Update/_1249.php new file mode 100644 index 000000000..6d72c4de4 --- /dev/null +++ b/Zotlabs/Update/_1249.php @@ -0,0 +1,31 @@ +<?php + +namespace Zotlabs\Update; + +class _1249 { + + function run() { + + dbq("START TRANSACTION"); + + if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) { + $r1 = dbq("ALTER TABLE abook ADD abook_role TEXT NOT NULL DEFAULT ''"); + $r2 = dbq("CREATE INDEX \"abook_role\" ON abook (\"abook_role\")"); + $r = ($r1 && $r2); + } + else { + $r = dbq("ALTER TABLE `abook` ADD `abook_role` CHAR(191) NOT NULL DEFAULT '' , + ADD INDEX `abook_role` (`abook_role`)"); + } + + if($r) { + dbq("COMMIT"); + return UPDATE_SUCCESS; + } + + dbq("ROLLBACK"); + return UPDATE_FAILED; + + } + +} diff --git a/Zotlabs/Update/_1250.php b/Zotlabs/Update/_1250.php new file mode 100644 index 000000000..bc50479d4 --- /dev/null +++ b/Zotlabs/Update/_1250.php @@ -0,0 +1,31 @@ +<?php + +namespace Zotlabs\Update; + +class _1250 { + + function run() { + + dbq("START TRANSACTION"); + + if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) { + $r1 = dbq("ALTER TABLE atoken ADD atoken_guid VARCHAR(255) NOT NULL DEFAULT ''"); + $r2 = dbq("CREATE INDEX \"atoken_guid\" ON atoken (\"atoken_guid\")"); + $r = ($r1 && $r2); + } + else { + $r = dbq("ALTER TABLE `atoken` ADD `atoken_guid` CHAR(191) NOT NULL DEFAULT '' , + ADD INDEX `atoken_guid` (`atoken_guid`)"); + } + + if($r) { + dbq("COMMIT"); + return UPDATE_SUCCESS; + } + + dbq("ROLLBACK"); + return UPDATE_FAILED; + + } + +} diff --git a/Zotlabs/Update/_1251.php b/Zotlabs/Update/_1251.php new file mode 100644 index 000000000..ee72075d1 --- /dev/null +++ b/Zotlabs/Update/_1251.php @@ -0,0 +1,23 @@ +<?php + +namespace Zotlabs\Update; + +class _1251 { + + function run() { + + dbq("START TRANSACTION"); + + $r = dbq("DELETE FROM app WHERE (app_name = 'Channel Home' OR app_name = 'Permission Categories') AND app_system = 1"); + + if($r) { + dbq("COMMIT"); + return UPDATE_SUCCESS; + } + + dbq("ROLLBACK"); + return UPDATE_FAILED; + + } + +} diff --git a/Zotlabs/Update/_1252.php b/Zotlabs/Update/_1252.php new file mode 100644 index 000000000..97bb58d9d --- /dev/null +++ b/Zotlabs/Update/_1252.php @@ -0,0 +1,23 @@ +<?php + +namespace Zotlabs\Update; + +class _1252 { + + function run() { + + dbq("START TRANSACTION"); + + $r = dbq("DELETE FROM app WHERE app_plugin = 'mail' AND app_system = 1"); + + if($r) { + dbq("COMMIT"); + return UPDATE_SUCCESS; + } + + dbq("ROLLBACK"); + return UPDATE_FAILED; + + } + +} |