aboutsummaryrefslogtreecommitdiffstats
path: root/install
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2017-10-20 10:08:57 +0200
committerMario Vavti <mario@mariovavti.com>2017-10-20 10:08:57 +0200
commitc80f4feb6234ff195171a92704d7ebe24aff4336 (patch)
treed9149141f52e3758afe1dfa8387bbd8229de1cc9 /install
parent2d06e86b5b99af3a5e6c65f4c510bdeaddd5126a (diff)
parent400441d56b21e69663ea7213ccf63fe0ee6a6bab (diff)
downloadvolse-hubzilla-c80f4feb6234ff195171a92704d7ebe24aff4336.tar.gz
volse-hubzilla-c80f4feb6234ff195171a92704d7ebe24aff4336.tar.bz2
volse-hubzilla-c80f4feb6234ff195171a92704d7ebe24aff4336.zip
Merge remote-tracking branch 'mike/master' into dev
Diffstat (limited to 'install')
-rw-r--r--install/schema_mysql.sql13
-rw-r--r--install/schema_postgres.sql13
-rw-r--r--install/update.php40
3 files changed, 65 insertions, 1 deletions
diff --git a/install/schema_mysql.sql b/install/schema_mysql.sql
index 3143854f5..afa3c095d 100644
--- a/install/schema_mysql.sql
+++ b/install/schema_mysql.sql
@@ -900,6 +900,19 @@ CREATE TABLE IF NOT EXISTS `outq` (
KEY `outq_priority` (`outq_priority`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
+
+CREATE TABLE IF NOT EXISTS pchan (
+ `pchan_id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
+ `pchan_guid` char(191) NOT NULL DEFAULT '',
+ `pchan_hash` char(191) NOT NULL DEFAULT '',
+ `pchan_pubkey` text NOT NULL,
+ `pchan_prvkey` text NOT NULL,
+ PRIMARY KEY (`pchan_id`),
+ KEY `pchan_guid` (`pchan_guid`),
+ KEY `pchan_hash` (`pchan_hash`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
+
+
CREATE TABLE IF NOT EXISTS `pconfig` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`uid` int(11) NOT NULL DEFAULT 0 ,
diff --git a/install/schema_postgres.sql b/install/schema_postgres.sql
index 65acb644b..082817a60 100644
--- a/install/schema_postgres.sql
+++ b/install/schema_postgres.sql
@@ -872,6 +872,19 @@ create index "outq_async" on outq ("outq_async");
create index "outq_delivered" on outq ("outq_delivered");
create index "outq_priority" on outq ("outq_priority");
+
+CREATE TABLE "pchan" (
+ "pchan_id" serial NOT NULL,
+ "pchan_guid" text NOT NULL,
+ "pchan_hash" text NOT NULL,
+ "pchan_pubkey" text NOT NULL,
+ "pchan_prvkey" text NOT NULL,
+ PRIMARY KEY ("pchan_id")
+);
+
+create index "pchan_guid" on pchan ("pchan_guid");
+create index "pchan_hash" on pchan ("pchan_hash");
+
CREATE TABLE "pconfig" (
"id" serial NOT NULL,
"uid" bigint NOT NULL DEFAULT '0',
diff --git a/install/update.php b/install/update.php
index 07675a973..7d59555d3 100644
--- a/install/update.php
+++ b/install/update.php
@@ -1,6 +1,6 @@
<?php
-define( 'UPDATE_VERSION' , 1196 );
+define( 'UPDATE_VERSION' , 1197 );
/**
*
@@ -3022,3 +3022,41 @@ function update_r1195() {
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}
+
+function update_r1196() {
+
+ if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) {
+ $r1 = q("CREATE TABLE \"pchan\" (
+ \"pchan_id\" serial NOT NULL,
+ \"pchan_guid\" text NOT NULL,
+ \"pchan_hash\" text NOT NULL,
+ \"pchan_pubkey\" text NOT NULL,
+ \"pchan_prvkey\" text NOT NULL,
+ PRIMARY KEY (\"pchan_id\")
+)");
+
+ $r2 = q("create index \"pchan_guid\" on pchan (\"pchan_guid\")");
+ $r3 = q("create index \"pchan_hash\" on pchan (\"pchan_hash\")");
+
+ if($r1 && $r2 && $r3) {
+ return UPDATE_SUCCESS;
+ }
+ }
+ else {
+ $r1 = q("CREATE TABLE IF NOT EXISTS pchan (
+ pchan_id int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
+ pchan_guid char(191) NOT NULL DEFAULT '',
+ pchan_hash char(191) NOT NULL DEFAULT '',
+ pchan_pubkey text NOT NULL,
+ pchan_prvkey text NOT NULL,
+ PRIMARY KEY (pchan_id),
+ KEY pchan_guid (pchan_guid),
+ KEY pchan_hash (pchan_hash)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4");
+ if($r1) {
+ return UPDATE_SUCCESS;
+ }
+ }
+
+ return UPDATE_FAILED;
+} \ No newline at end of file