Blame view

sources/apps/search_lucene/appinfo/update.php 775 Bytes
42e4f8d60   Kload   add all apps
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
  <?php
  
  $currentVersion=OC_Appconfig::getValue('search_lucene', 'installed_version');
  if (version_compare($currentVersion, '0.5.0', '<')) {
  	//force reindexing of files
  	$stmt = OCP\DB::prepare('DELETE FROM `*PREFIX*lucene_status` WHERE 1=1');
  	$stmt->execute();
  	//clear old background jobs
  	$stmt = OCP\DB::prepare('DELETE FROM `*PREFIX*queuedtasks` WHERE `app`=?');
  	$stmt->execute(array('search_lucene'));
  }
  
  if (version_compare($currentVersion, '0.5.2', '<')) {
  	//delete duplicate id entries
  	$stmt = OCP\DB::prepare('
  		DELETE FROM `*PREFIX*lucene_status`
  		WHERE `fileid` IN (
  			SELECT `fileid`
  			FROM (
  				SELECT `fileid`
  				FROM `*PREFIX*lucene_status`
  				GROUP BY `fileid`
  				HAVING count(`status`) > 1
  			) AS `mysqlerr1093hack`
  		)
  	');
  	$stmt->execute();
  }