aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Update/_1249.php
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs/Update/_1249.php')
-rw-r--r--Zotlabs/Update/_1249.php31
1 files changed, 31 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;
+
+ }
+
+}