Skip to content

Commit 2d40e67

Browse files
Merge pull request #2 from yorkshire-pudding/1.x-2.x
Add D7 upgrade path.
2 parents f8c00fa + f0738ce commit 2d40e67

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

gist_filter.install

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
33
* @file
4-
* Install and uninstall functions for the Gist Filter module.
4+
* Install, uninstall and update functions for the Gist Filter module.
55
*/
66

77
/**
@@ -13,3 +13,18 @@ function gist_filter_schema() {
1313
$schema['cache_gists'] = backdrop_get_schema_unprocessed('system', 'cache');
1414
return $schema;
1515
}
16+
17+
/**
18+
* Implements hook_update_N().
19+
*/
20+
function gist_filter_update_1200() {
21+
// We only need to add this for people upgrading from Drupal 7 who already
22+
// have the module installed. This table has been in Backdrop from the start,
23+
// so anyone installing new in Backdrop does not need this update.
24+
if (!db_table_exists('cache_gists')) {
25+
// Define a separate cache for gists so we have more control over when
26+
// the cached gists are cleared.
27+
$schema['cache_gists'] = backdrop_get_schema_unprocessed('system', 'cache');
28+
return $schema;
29+
}
30+
}

0 commit comments

Comments
 (0)