aboutsummaryrefslogtreecommitdiffstats
path: root/install/update.php
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-02-17 16:24:26 -0800
committerredmatrix <git@macgirvin.com>2016-02-17 16:24:26 -0800
commit4da7fcb41dd97669305551914964df57ffc22ee7 (patch)
treeb2fc2a5c702374caf2f4a27df66b751acf035bfb /install/update.php
parent3a84e7051e70ac9c26ec705155ac4020d9a64f62 (diff)
downloadvolse-hubzilla-4da7fcb41dd97669305551914964df57ffc22ee7.tar.gz
volse-hubzilla-4da7fcb41dd97669305551914964df57ffc22ee7.tar.bz2
volse-hubzilla-4da7fcb41dd97669305551914964df57ffc22ee7.zip
schema updates for iconfig
Diffstat (limited to 'install/update.php')
-rw-r--r--install/update.php39
1 files changed, 38 insertions, 1 deletions
diff --git a/install/update.php b/install/update.php
index 24f4f21d5..e96bda03c 100644
--- a/install/update.php
+++ b/install/update.php
@@ -1,6 +1,6 @@
<?php
-define( 'UPDATE_VERSION' , 1161 );
+define( 'UPDATE_VERSION' , 1162 );
/**
*
@@ -1957,3 +1957,40 @@ function update_r1160() {
return UPDATE_FAILED;
}
+function update_r1161() {
+
+ if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) {
+ $r1 = q("CREATE TABLE \"iconfig\" (
+ \"id\" serial NOT NULL,
+ \"iid\" bigint NOT NULL DEFAULT '0',
+ \"cat\" text NOT NULL DEFAULT '',
+ \"k\" text NOT NULL DEFAULT '',
+ \"v\" text NOT NULL DEFAULT '',
+ PRIMARY_KEY(\"id\")
+) ");
+$r2 = q("create index \"iconfig_iid\" on iconfig (\"iid\") ");;
+$r3 = q("create index \"iconfig_cat\" on iconfig (\"cat\") ");
+$r4 = q("create index \"iconfig_k\" on iconfig (\"k\") ");
+
+ $r = $r1 && $r2 && $r3 && $r4;
+ }
+ else {
+ $r = q("CREATE TABLE IF NOT EXISTS `iconfig` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `iid` int(11) NOT NULL DEFAULT '0',
+ `cat` char(255) NOT NULL DEFAULT '',
+ `k` char(255) NOT NULL DEFAULT '',
+ `v` mediumtext NOT NULL,
+ PRIMARY KEY (`id`),
+ KEY `iid` (`iid`),
+ KEY `cat` (`cat`),
+ KEY `k` (`k`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ");
+
+ }
+
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+