summaryrefslogtreecommitdiff
path: root/admin/upgrade_inc.php
blob: c192f9a29ce9e6ce1222553d8daacca5933f39e9 (plain)
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php

global $gBitSystem, $gUpgradeFrom, $gUpgradeTo;

$upgrades = array(

'BONNIE' => array(
	'CLYDE' => array(
// STEP 1 - Data is transient, so let's recreate the table with proper  multi-column keys
array( 'DATADICT' => array(
	array( 'DROPTABLE' => array(
		'tiki_searchindex'
	)),
	array( 'CREATE' => array (
	'tiki_searchindex' => "
	searchword C(80) PRIMARY,
	location C(80) PRIMARY,
	content_id I4 PRIMARY,
	count I4 NOTNULL default '1',
	last_update I4 NOTNULL
	",
	)),
)),

// STEP 2
array( 'DATADICT' => array(
	array( 'RENAMECOLUMN' => array(
		'tiki_searchsyllable' => array( '`lastUsed`' => '`last_used` I8',
										'`lastUpdated`' => '`last_updated` I8' ),
	)),
)),

// STEP 3
array( 'DATADICT' => array(
	array( 'CREATEINDEX' => array(
		'tiki_searchidx_con_id_idx' => array( 'tiki_searchindex', '`content_id`', array() ),
		'tiki_searchidx_word_idx' => array( 'tiki_searchindex', '`searchword`', array() ),
		'tiki_searchidx_loc_idx' => array( 'tiki_searchindex', '`location`', array() ),
		'tiki_searchidx_update_idx' => array( 'tiki_searchindex', '`last_update`', array() ),
	)),
)),

	)
)

);

if( isset( $upgrades[$gUpgradeFrom][$gUpgradeTo] ) ) {
	$gBitSystem->registerUpgrade( SEARCH_PKG_NAME, $upgrades[$gUpgradeFrom][$gUpgradeTo] );
}


?>