aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Update/_1133.php
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs/Update/_1133.php')
-rw-r--r--Zotlabs/Update/_1133.php38
1 files changed, 38 insertions, 0 deletions
diff --git a/Zotlabs/Update/_1133.php b/Zotlabs/Update/_1133.php
new file mode 100644
index 000000000..3820ef1ee
--- /dev/null
+++ b/Zotlabs/Update/_1133.php
@@ -0,0 +1,38 @@
+<?php
+
+namespace Zotlabs\Update;
+
+class _1133 {
+function run() {
+ if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) {
+ $r1 = q("CREATE TABLE xperm (
+ xp_id serial NOT NULL,
+ xp_client varchar( 20 ) NOT NULL DEFAULT '',
+ xp_channel bigint NOT NULL DEFAULT '0',
+ xp_perm varchar( 64 ) NOT NULL DEFAULT '',
+ PRIMARY KEY (xp_id) )");
+ $r2 = 0;
+ foreach(array('xp_client', 'xp_channel', 'xp_perm') as $fld)
+ $r2 += ((q("create index $fld on xperm ($fld)") == false) ? 0 : 1);
+
+ $r = (($r1 && $r2) ? true : false);
+ }
+ else {
+ $r = q("CREATE TABLE IF NOT EXISTS `xperm` (
+ `xp_id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
+ `xp_client` VARCHAR( 20 ) NOT NULL DEFAULT '',
+ `xp_channel` INT UNSIGNED NOT NULL DEFAULT '0',
+ `xp_perm` VARCHAR( 64 ) NOT NULL DEFAULT '',
+ KEY `xp_client` (`xp_client`),
+ KEY `xp_channel` (`xp_channel`),
+ KEY `xp_perm` (`xp_perm`)
+ ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ");
+ }
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+
+}
+
+
+} \ No newline at end of file