diff options
author | Andrew Manning <tamanning@zoho.com> | 2018-02-20 21:11:59 -0500 |
---|---|---|
committer | Andrew Manning <tamanning@zoho.com> | 2018-02-20 21:11:59 -0500 |
commit | 8e5c1135c3e2644ea8501eda067e2b994faa44ab (patch) | |
tree | 6b72038214359dcf8eff040a68874583e7174800 /Zotlabs/Update/_1133.php | |
parent | 89a825cd038df7da609d64ef0254ba58caaede31 (diff) | |
parent | 85a6dd60316eefbdaf072e59621d681a3cf2546b (diff) | |
download | volse-hubzilla-8e5c1135c3e2644ea8501eda067e2b994faa44ab.tar.gz volse-hubzilla-8e5c1135c3e2644ea8501eda067e2b994faa44ab.tar.bz2 volse-hubzilla-8e5c1135c3e2644ea8501eda067e2b994faa44ab.zip |
Merge branch 'dev' into oauth2
Diffstat (limited to 'Zotlabs/Update/_1133.php')
-rw-r--r-- | Zotlabs/Update/_1133.php | 38 |
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 |