diff options
author | redmatrix <redmatrix@redmatrix.me> | 2015-08-31 21:00:28 -0700 |
---|---|---|
committer | redmatrix <redmatrix@redmatrix.me> | 2015-08-31 21:00:28 -0700 |
commit | d7089ab471d446453f41ba1311b3d7186d86ff4c (patch) | |
tree | ce75108ac809d77d33217e8e844ec0a8b0e3965b /install | |
parent | 039f56f390c69ad0aedadcca3d611fea0d9eebf9 (diff) | |
parent | d7cae1ce2abfda2049bcb9510ae1916865bb55a3 (diff) | |
download | volse-hubzilla-d7089ab471d446453f41ba1311b3d7186d86ff4c.tar.gz volse-hubzilla-d7089ab471d446453f41ba1311b3d7186d86ff4c.tar.bz2 volse-hubzilla-d7089ab471d446453f41ba1311b3d7186d86ff4c.zip |
Merge https://github.com/redmatrix/redmatrix into pending_merge
Conflicts:
include/identity.php
install/update.php
util/messages.po
view/nl/messages.po
Diffstat (limited to 'install')
-rw-r--r-- | install/schema_mysql.sql | 2 | ||||
-rw-r--r-- | install/schema_postgres.sql | 2 | ||||
-rw-r--r-- | install/update.php | 22 |
3 files changed, 25 insertions, 1 deletions
diff --git a/install/schema_mysql.sql b/install/schema_mysql.sql index aaeab4f87..5ee1ec463 100644 --- a/install/schema_mysql.sql +++ b/install/schema_mysql.sql @@ -688,6 +688,7 @@ CREATE TABLE IF NOT EXISTS `likes` ( `liker` char(128) NOT NULL DEFAULT '', `likee` char(128) NOT NULL DEFAULT '', `iid` int(11) unsigned NOT NULL DEFAULT '0', + `i_mid` char(255) NOT NULL DEFAULT '', `verb` char(255) NOT NULL DEFAULT '', `target_type` char(255) NOT NULL DEFAULT '', `target_id` char(128) NOT NULL DEFAULT '', @@ -696,6 +697,7 @@ CREATE TABLE IF NOT EXISTS `likes` ( KEY `liker` (`liker`), KEY `likee` (`likee`), KEY `iid` (`iid`), + KEY `i_mid` (`i_mid`), KEY `verb` (`verb`), KEY `target_type` (`target_type`), KEY `channel_id` (`channel_id`), diff --git a/install/schema_postgres.sql b/install/schema_postgres.sql index da5a503e7..c594d0f87 100644 --- a/install/schema_postgres.sql +++ b/install/schema_postgres.sql @@ -681,6 +681,7 @@ CREATE TABLE "likes" ( "liker" char(128) NOT NULL DEFAULT '', "likee" char(128) NOT NULL DEFAULT '', "iid" bigint NOT NULL DEFAULT '0', + "i_mid" char(255) NOT NULL DEFAULT '', "verb" text NOT NULL DEFAULT '', "target_type" text NOT NULL DEFAULT '', "target_id" char(128) NOT NULL DEFAULT '', @@ -691,6 +692,7 @@ create index "likes_channel_id" on likes ("channel_id"); create index "likes_liker" on likes ("liker"); create index "likes_likee" on likes ("likee"); create index "likes_iid" on likes ("iid"); +create index "likes_i_mid" on likes ("i_mid"); create index "likes_verb" on likes ("verb"); create index "likes_target_type" on likes ("target_type"); create index "likes_target_id" on likes ("target_id"); diff --git a/install/update.php b/install/update.php index 9aca14d2e..b398711b2 100644 --- a/install/update.php +++ b/install/update.php @@ -1,6 +1,6 @@ <?php -define( 'UPDATE_VERSION' , 1148 ); +define( 'UPDATE_VERSION' , 1149 ); /** * @@ -1728,3 +1728,23 @@ function update_r1147() { return UPDATE_SUCCESS; return UPDATE_FAILED; } + +function update_r1148() { + $r1 = q("alter table likes add i_mid char(255) not null default '' "); + $r2 = q("create index i_mid on likes ( i_mid ) "); + + $r3 = q("select likes.*, item.mid from from likes left join item on likes.iid = item.id"); + if($r3) { + foreach($r3 as $rr) { + q("update likes set i_mid = '%s' where id = $d", + dbesc($rr['mid']), + intval($rr['id']) + ); + } + } + + if($r1 && $r2) + return UPDATE_SUCCESS; + return UPDATE_FAILED; + +} |