Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 115 lines (109 sloc) 2.813 kb
9ca94c2 Steven Jones Copy over the changes from github.
darthsteven authored
1 <?php
2 // $Id$
3
4 /**
5 * @file
6 * Install file for views content cache.
7 */
8
9 /**
10 * Implementation of hook_schema().
11 */
12 function views_content_cache_schema() {
13 return views_content_cache_schema_6001();
14 }
15
16 /**
17 * Schema version 6001.
18 *
19 * We'va added a table here that can store timestamps against various cache
20 * segments. These get dynamically mapped to real cache segments, like node type
21 * or organic group ID.
22 */
23 function views_content_cache_schema_6001() {
24 $schema = array();
25 $schema['views_content_cache'] = array(
26 'description' => 'Stores timestamps for various cache segments showing the last time the segment changed.',
27 'fields' => array(
28 'timestamp' => array(
29 'type' => 'int',
30 'not null' => TRUE,
31 'default' => 0,
32 'description' => 'Updated timestamp for a given cache segment.',
33 ),
34 'c1' => array(
35 'type' => 'varchar',
36 'length' => 255,
37 'default' => NULL,
38 'description' => 'Cache segment 1.',
39 ),
40 'c2' => array(
41 'type' => 'varchar',
42 'length' => 255,
43 'default' => NULL,
44 'description' => 'Cache segment 2.',
45 ),
46 'c3' => array(
47 'type' => 'varchar',
48 'length' => 255,
49 'default' => NULL,
50 'description' => 'Cache segment 3.',
51 ),
52 'c4' => array(
53 'type' => 'varchar',
54 'length' => 255,
55 'default' => NULL,
56 'description' => 'Cache segment 4.',
57 ),
58 'c5' => array(
59 'type' => 'varchar',
60 'length' => 255,
61 'default' => NULL,
62 'description' => 'Cache segment 5.',
63 ),
64 'c6' => array(
65 'type' => 'varchar',
66 'length' => 255,
67 'default' => NULL,
68 'description' => 'Cache segment 6.',
69 ),
70 'c7' => array(
71 'type' => 'varchar',
72 'length' => 255,
73 'default' => NULL,
74 'description' => 'Cache segment 7.',
75 ),
76 'c8' => array(
77 'type' => 'varchar',
78 'length' => 255,
79 'default' => NULL,
80 'description' => 'Cache segment 8.',
81 ),
82 ),
83 'indexes' => array(
84 'timestamp' => array('timestamp'),
85 'c1' => array('c1'),
86 'c2' => array('c2'),
87 'c3' => array('c3'),
88 'c4' => array('c4'),
89 'c5' => array('c5'),
90 'c6' => array('c6'),
91 'c7' => array('c7'),
92 'c8' => array('c8'),
93 ),
94 );
95 return $schema;
96 }
97
98 /**
99 * Implementation of hook_install().
100 */
101 function views_content_cache_install() {
102 drupal_install_schema('views_content_cache');
103 }
104
105 /**
106 * Update 6001: Create tables for schema version 6001.
107 */
108 function views_content_cache_update_6001() {
109 $ret = array();
110 foreach (views_content_cache_schema_6001() as $name => $table) {
111 db_create_table($ret, $name, $table);
112 }
113 return $ret;
114 }
Something went wrong with that request. Please try again.