summaryrefslogtreecommitdiff
path: root/platform/default/mbgl/storage/offline_schema.cpp.include
blob: 41af81e55b17dbbb960e16e1e50f5ddabdf884c9 (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
54
55
/* THIS IS A GENERATED FILE; EDIT offline_schema.sql INSTEAD */
static const char * schema = 
"CREATE TABLE resources (\n"
"  id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,\n"
"  url TEXT NOT NULL,\n"
"  kind INTEGER NOT NULL,\n"
"  expires INTEGER,\n"
"  modified INTEGER,\n"
"  etag TEXT,\n"
"  data BLOB,\n"
"  compressed INTEGER NOT NULL DEFAULT 0,\n"
"  accessed INTEGER NOT NULL,\n"
"  must_revalidate INTEGER NOT NULL DEFAULT 0,\n"
"  UNIQUE (url)\n"
");\n"
"CREATE TABLE tiles (\n"
"  id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,\n"
"  url_template TEXT NOT NULL,\n"
"  pixel_ratio INTEGER NOT NULL,\n"
"  z INTEGER NOT NULL,\n"
"  x INTEGER NOT NULL,\n"
"  y INTEGER NOT NULL,\n"
"  expires INTEGER,\n"
"  modified INTEGER,\n"
"  etag TEXT,\n"
"  data BLOB,\n"
"  compressed INTEGER NOT NULL DEFAULT 0,\n"
"  accessed INTEGER NOT NULL,\n"
"  must_revalidate INTEGER NOT NULL DEFAULT 0,\n"
"  UNIQUE (url_template, pixel_ratio, z, x, y)\n"
");\n"
"CREATE TABLE regions (\n"
"  id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,\n"
"  definition TEXT NOT NULL,\n"
"  description BLOB\n"
");\n"
"CREATE TABLE region_resources (\n"
"  region_id INTEGER NOT NULL REFERENCES regions(id) ON DELETE CASCADE,\n"
"  resource_id INTEGER NOT NULL REFERENCES resources(id),\n"
"  UNIQUE (region_id, resource_id)\n"
");\n"
"CREATE TABLE region_tiles (\n"
"  region_id INTEGER NOT NULL REFERENCES regions(id) ON DELETE CASCADE,\n"
"  tile_id INTEGER NOT NULL REFERENCES tiles(id),\n"
"  UNIQUE (region_id, tile_id)\n"
");\n"
"CREATE INDEX resources_accessed\n"
"ON resources (accessed);\n"
"CREATE INDEX tiles_accessed\n"
"ON tiles (accessed);\n"
"CREATE INDEX region_resources_resource_id\n"
"ON region_resources (resource_id);\n"
"CREATE INDEX region_tiles_tile_id\n"
"ON region_tiles (tile_id);\n"
;