aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2015-01-19 20:06:12 -0800
committerfriendica <info@friendica.com>2015-01-19 20:06:12 -0800
commite3041b80fd28d88b5f9ba063cb8147b9b0a61668 (patch)
tree34e40ae83ce43d88527d0e45a6c84e8f61596da1
parentced0685d67a608c3b7ad89dabb3f9af725b49ba2 (diff)
downloadvolse-hubzilla-e3041b80fd28d88b5f9ba063cb8147b9b0a61668.tar.gz
volse-hubzilla-e3041b80fd28d88b5f9ba063cb8147b9b0a61668.tar.bz2
volse-hubzilla-e3041b80fd28d88b5f9ba063cb8147b9b0a61668.zip
oauth permissions table
-rwxr-xr-xboot.php2
-rw-r--r--install/schema_mysql.sql16
-rw-r--r--install/schema_postgres.sql10
-rw-r--r--install/update.php34
4 files changed, 59 insertions, 3 deletions
diff --git a/boot.php b/boot.php
index 2022ab2c1..bca90fd27 100755
--- a/boot.php
+++ b/boot.php
@@ -49,7 +49,7 @@ define ( 'RED_PLATFORM', 'redmatrix' );
define ( 'RED_VERSION', trim(file_get_contents('version.inc')) . 'R');
define ( 'ZOT_REVISION', 1 );
-define ( 'DB_UPDATE_VERSION', 1133 );
+define ( 'DB_UPDATE_VERSION', 1134 );
/**
* Constant with a HTML line break.
diff --git a/install/schema_mysql.sql b/install/schema_mysql.sql
index ce3f07a89..52570898b 100644
--- a/install/schema_mysql.sql
+++ b/install/schema_mysql.sql
@@ -1540,6 +1540,22 @@ CREATE TABLE IF NOT EXISTS `xlink` (
-- --------------------------------------------------------
--
+-- Table structure for table `xperm`
+--
+
+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;
+
+-- --------------------------------------------------------
+
+--
-- Table structure for table `xprof`
--
diff --git a/install/schema_postgres.sql b/install/schema_postgres.sql
index 85eb802d2..a1b5a76fb 100644
--- a/install/schema_postgres.sql
+++ b/install/schema_postgres.sql
@@ -1149,6 +1149,16 @@ create index "xlink_xchan" on xlink ("xlink_xchan");
create index "xlink_link" on xlink ("xlink_link");
create index "xlink_updated" on xlink ("xlink_updated");
create index "xlink_rating" on xlink ("xlink_rating");
+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")
+);
+create index "xp_client" on xperm ("xp_client");
+create index "xp_channel" on xperm ("xp_channel");
+create index "xp_perm" on xperm ("xp_perm");
CREATE TABLE "xprof" (
"xprof_hash" text NOT NULL,
"xprof_age" numeric(3) NOT NULL DEFAULT '0',
diff --git a/install/update.php b/install/update.php
index 381ea0828..a8cecef5a 100644
--- a/install/update.php
+++ b/install/update.php
@@ -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;
-} \ No newline at end of file
+}
+
+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;
+
+}