diff options
Diffstat (limited to 'Zotlabs/Update')
-rw-r--r-- | Zotlabs/Update/_1249.php | 31 | ||||
-rw-r--r-- | Zotlabs/Update/_1250.php | 31 | ||||
-rw-r--r-- | Zotlabs/Update/_1251.php | 23 |
3 files changed, 85 insertions, 0 deletions
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; + + } + +} |