summaryrefslogtreecommitdiff
path: root/platform/default/mbgl/storage/offline_schema.cpp.include
blob: 31b11d5f12e7eff06edbdbc7d94bd412f7d3bd8e (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
/* THIS IS A GENERATED FILE; EDIT offline_schema.sql INSTEAD */
static const char * schema = 
"CREATE TABLE resources (\n"
"  url TEXT NOT NULL PRIMARY KEY,\n"
"  kind INTEGER NOT NULL,\n"
"  expires INTEGER,\n"
"  modified INTEGER,\n"
"  accessed INTEGER,\n"
"  etag TEXT,\n"
"  data BLOB,\n"
"  compressed INTEGER NOT NULL DEFAULT 0\n"
");\n"
"CREATE TABLE tilesets (\n"
"  id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,\n"
"  url_template TEXT NOT NULL,\n"
"  pixel_ratio INTEGER,\n"
"  UNIQUE (url_template, pixel_ratio)\n"
");\n"
"CREATE TABLE tiles (\n"
"  tileset_id INTEGER NOT NULL REFERENCES tilesets(id),\n"
"  z INTEGER NOT NULL,\n"
"  x INTEGER NOT NULL,\n"
"  y INTEGER NOT NULL,\n"
"  expires INTEGER,\n"
"  modified INTEGER,\n"
"  accessed INTEGER,\n"
"  etag TEXT,\n"
"  data BLOB,\n"
"  compressed INTEGER NOT NULL DEFAULT 0,\n"
"  PRIMARY KEY (tileset_id, 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),\n"
"  resource_url TEXT NOT NULL REFERENCES resources(url),\n"
"  PRIMARY KEY (region_id, resource_url)\n"
");\n"
"CREATE TABLE region_tiles (\n"
"  region_id INTEGER NOT NULL REFERENCES regions(id),\n"
"  tileset_id INTEGER NOT NULL REFERENCES tilesets(id),\n"
"  z INTEGER NOT NULL,\n"
"  x INTEGER NOT NULL,\n"
"  y INTEGER NOT NULL,\n"
"  PRIMARY KEY (region_id, tileset_id, z, x, y),\n"
"  FOREIGN KEY (tileset_id, z, x, y) REFERENCES tiles (tileset_id, z, x, y)\n"
");\n"
;