oauth permissions table

This commit is contained in:
friendica
2015-01-19 20:06:12 -08:00
parent ced0685d67
commit e3041b80fd
4 changed files with 59 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
<?php
define( 'UPDATE_VERSION' , 1133 );
define( 'UPDATE_VERSION' , 1134 );
/**
*
@@ -1506,4 +1506,34 @@ function update_r1132() {
return UPDATE_FAILED;
}
return UPDATE_SUCCESS;
}
}
function update_r1133() {
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 = q("create index \"xp_client\" on xperm (\"xp_client\",
create index \"xp_channel\" on xperm (\"xp_channel\"),
create index \"xp_perm\" on xperm (\"xp_perm\") ");
$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;
}