aboutsummaryrefslogtreecommitdiffstats
path: root/install/update.php
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-10-22 19:32:08 -0700
committerzotlabs <mike@macgirvin.com>2017-10-22 19:32:08 -0700
commitc49eec71f0995cd75be99a64a4dde398f9f0241b (patch)
tree06e29769c32460299d9c73794028e657e362b6e2 /install/update.php
parentcdb1bc9be6fbc09caff62c0153386cc58a2bfbd9 (diff)
parentb58bf75f21d15ac440bb3a90edb29afac9eb64ba (diff)
downloadvolse-hubzilla-c49eec71f0995cd75be99a64a4dde398f9f0241b.tar.gz
volse-hubzilla-c49eec71f0995cd75be99a64a4dde398f9f0241b.tar.bz2
volse-hubzilla-c49eec71f0995cd75be99a64a4dde398f9f0241b.zip
Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge
Diffstat (limited to 'install/update.php')
-rw-r--r--install/update.php40
1 files changed, 39 insertions, 1 deletions
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