diff options
author | Haakon Meland Eriksen <haakon.eriksen@far.no> | 2016-03-02 06:06:39 +0100 |
---|---|---|
committer | Haakon Meland Eriksen <haakon.eriksen@far.no> | 2016-03-02 06:06:39 +0100 |
commit | 264abef81761a3ed0d27126dbc5a6e0a47fb8ec8 (patch) | |
tree | 883418e21b721217b28380f9313405373825650a /install | |
parent | e084a85e79af2c56f6e715fcf44a1be815ea5c45 (diff) | |
parent | a0baa480e3968306c8ebc297a60f84b4d2ccf8c9 (diff) | |
download | volse-hubzilla-264abef81761a3ed0d27126dbc5a6e0a47fb8ec8.tar.gz volse-hubzilla-264abef81761a3ed0d27126dbc5a6e0a47fb8ec8.tar.bz2 volse-hubzilla-264abef81761a3ed0d27126dbc5a6e0a47fb8ec8.zip |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'install')
-rw-r--r-- | install/schema_mysql.sql | 14 | ||||
-rw-r--r-- | install/schema_postgres.sql | 15 | ||||
-rw-r--r-- | install/update.php | 43 |
3 files changed, 69 insertions, 3 deletions
diff --git a/install/schema_mysql.sql b/install/schema_mysql.sql index 07a88cf0a..01cf97674 100644 --- a/install/schema_mysql.sql +++ b/install/schema_mysql.sql @@ -1,4 +1,18 @@ +CREATE TABLE IF NOT EXISTS `abconfig` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `chan` char(255) NOT NULL DEFAULT '', + `xchan` char(255) NOT NULL DEFAULT '', + `cat` char(255) NOT NULL DEFAULT '', + `k` char(255) NOT NULL DEFAULT '', + `v` mediumtext NOT NULL, + PRIMARY KEY (`id`), + KEY `chan` (`chan`), + KEY `xchan` (`xchan`), + KEY `cat` (`cat`), + KEY `k` (`k`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + CREATE TABLE IF NOT EXISTS `abook` ( `abook_id` int(10) unsigned NOT NULL AUTO_INCREMENT, `abook_account` int(10) unsigned NOT NULL DEFAULT '0', diff --git a/install/schema_postgres.sql b/install/schema_postgres.sql index 3302ef6c0..a7cd5875c 100644 --- a/install/schema_postgres.sql +++ b/install/schema_postgres.sql @@ -1,3 +1,16 @@ +CREATE TABLE "abconfig" ( + "id" serial NOT NULL, + "chan" text NOT NULL, + "xchan" text NOT NULL, + "cat" text NOT NULL, + "k" text NOT NULL, + "v" text NOT NULL, + PRIMARY KEY ("id") +); +create index "abconfig_chan" on abconfig ("chan"); +create index "abconfig_xchan" on abconfig ("xchan"); +create index "abconfig_cat" on abconfig ("cat"); +create index "abconfig_k" on abconfig ("k"); CREATE TABLE "abook" ( "abook_id" serial NOT NULL, "abook_account" bigint NOT NULL, @@ -547,7 +560,7 @@ CREATE TABLE "iconfig" ( "k" text NOT NULL DEFAULT '', "v" text NOT NULL DEFAULT '', "sharing" int NOT NULL DEFAULT '0', - PRIMARY_KEY("id") + PRIMARY KEY("id") ); create index "iconfig_iid" on iconfig ("iid"); create index "iconfig_cat" on iconfig ("cat"); diff --git a/install/update.php b/install/update.php index 0f9b3ab28..bfd01494f 100644 --- a/install/update.php +++ b/install/update.php @@ -1,6 +1,6 @@ <?php -define( 'UPDATE_VERSION' , 1164 ); +define( 'UPDATE_VERSION' , 1165 ); /** * @@ -2018,4 +2018,43 @@ function update_r1163() { if($r1 && $r2) return UPDATE_SUCCESS; return UPDATE_FAILED; -}
\ No newline at end of file +} + +function update_r1164() { + + if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) { + $r1 = q("CREATE TABLE \"abconfig\" ( + \"id\" serial NOT NULL, + \"chan\" text NOT NULL, + \"xchan\" text NOT NULL, + \"cat\" text NOT NULL, + \"k\" text NOT NULL, + \"v\" text NOT NULL, + PRIMARY KEY (\"id\") "); + $r2 = q("create index \"abconfig_chan\" on abconfig (\"chan\") "); + $r3 = q("create index \"abconfig_xchan\" on abconfig (\"xchan\") "); + $r4 = q("create index \"abconfig_cat\" on abconfig (\"cat\") "); + $r5 = q("create index \"abconfig_k\" on abconfig (\"k\") "); + $r = $r1 && $r2 && $r3 && $r4 && $r5; + } + else { + $r = q("CREATE TABLE IF NOT EXISTS `abconfig` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `chan` char(255) NOT NULL DEFAULT '', + `xchan` char(255) NOT NULL DEFAULT '', + `cat` char(255) NOT NULL DEFAULT '', + `k` char(255) NOT NULL DEFAULT '', + `v` mediumtext NOT NULL, + PRIMARY KEY (`id`), + KEY `chan` (`chan`), + KEY `xchan` (`xchan`), + KEY `cat` (`cat`), + KEY `k` (`k`) + ) ENGINE=MyISAM DEFAULT CHARSET=utf8 "); + + } + if($r) + return UPDATE_SUCCESS; + return UPDATE_FAILED; +} + |