blob: f7ef83faaabf1a54d17908172ca62f316d83b6c4 [file] [log] [blame]
Adrià Vilanova Martínezf19ea432024-01-23 20:20:52 +01001-- Copyright 2016 The Chromium Authors
2-- Use of this source code is governed by a BSD-style license that can be
3-- found in the LICENSE file.
Copybara854996b2021-09-07 19:36:02 +00004
5
6-- Create app framework tables in the monorail DB.
7
8ALTER DATABASE monorail CHARACTER SET = utf8 COLLATE = utf8_unicode_ci;
9
10-- This table allows frontends to selectively invalidate their RAM caches.
11-- On each incoming request, the frontend queries this table to get all rows
12-- that are newer than the last row that it saw. Then it processes each such
13-- row by dropping entries from its RAM caches, and remembers the new highest
14-- timestep that it has seen.
15CREATE TABLE Invalidate (
16 -- The time at which the invalidation took effect, by that time new data
17 -- should be available to retrieve to fill local caches as needed.
18 -- This is not a clock value, it is just an integer that counts up by one
19 -- on each change.
20 timestep BIGINT NOT NULL AUTO_INCREMENT,
21
22 -- Which kind of entity was invalidated? Each kind is broad, e.g.,
23 -- invalidating a project also invalidates all issue tracker config within
24 -- that project. But, they do not nest. E.g., invalidating a project does
25 -- not invalidate all issues in the project.
26 kind enum('user', 'usergroup', 'project', 'issue', 'issue_id',
27 'hotlist', 'comment', 'template', 'hotlist_id') NOT NULL,
28
29 -- Which cache entry should be invalidated? Special value 0 indicates
30 -- that all entries should be invalidated.
31 cache_key INT UNSIGNED,
32
33 INDEX (timestep)
34) ENGINE=INNODB;