| 6 |
* Module does not support InnoDB or PostgreSQL, so no changes for it |
* Module does not support InnoDB or PostgreSQL, so no changes for it |
| 7 |
*/ |
*/ |
| 8 |
function similar_install() { |
function similar_install() { |
| 9 |
db_query('ALTER TABLE {node_revisions} ENGINE = MYISAM'); |
db_query('ALTER TABLE {node_revision} ENGINE = MYISAM'); |
| 10 |
db_query('ALTER TABLE {node_revisions} ADD FULLTEXT `similar` (`title`, `body`)'); |
db_query('ALTER TABLE {node_revision} ADD FULLTEXT `similar` (`title`, `body`)'); |
| 11 |
} |
} |
| 12 |
|
|
| 13 |
function similar_uninstall() { |
function similar_uninstall() { |
| 19 |
variable_del('similar_teaser_enabled'); |
variable_del('similar_teaser_enabled'); |
| 20 |
|
|
| 21 |
$ret = array(); |
$ret = array(); |
| 22 |
$ret[] = update_sql("DELETE FROM {blocks} WHERE module = 'similar'"); |
$ret[] = update_sql("DELETE FROM {block} WHERE module = 'similar'"); |
| 23 |
db_drop_index($ret, 'node_revisions', 'similar'); |
db_drop_index($ret, 'node_revision', 'similar'); |
|
return $ret; |
|
|
} |
|
|
|
|
|
/** |
|
|
* Add a FULLTEXT index to the title and body fields in the node_revisions table. |
|
|
*/ |
|
|
function similar_update_1() { |
|
|
$ret = array(); |
|
|
$ret[] = update_sql('ALTER TABLE {node_revisions} DROP INDEX `title`, ADD FULLTEXT `similar` (`title`, `body`)'); |
|
| 24 |
return $ret; |
return $ret; |
| 25 |
} |
} |
| 26 |
|
|
| 37 |
|
|
| 38 |
$ret = array(); |
$ret = array(); |
| 39 |
// 5 == BLOCK_CACHE_PER_PAGE | BLOCK_CACHE_PER_ROLE |
// 5 == BLOCK_CACHE_PER_PAGE | BLOCK_CACHE_PER_ROLE |
| 40 |
$ret[] = update_sql("UPDATE {blocks} SET cache = 5 WHERE module = 'similar'"); |
$ret[] = update_sql("UPDATE {block} SET cache = 5 WHERE module = 'similar'"); |
| 41 |
return $ret; |
return $ret; |
| 42 |
} |
} |