sub-component depth from pts database on component evidence request
[strongswan.git] / src / libimcv / plugins / imv_attestation / tables.sql
1 /* PTS SQLite database */
2
3 DROP TABLE IF EXISTS files;
4 CREATE TABLE files (
5 id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
6 type INTEGER NOT NULL,
7 path TEXT NOT NULL,
8 measurement INTEGER DEFAULT 0,
9 metadata INTEGER DEFAULT 0
10 );
11
12 DROP TABLE IF EXISTS components;
13 CREATE TABLE components (
14 id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
15 vendor_id INTEGER NOT NULL,
16 name INTEGER NOT NULL,
17 qualifier INTEGER DEFAULT 0
18 );
19
20 DROP TABLE IF EXISTS products;
21 CREATE TABLE products (
22 id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
23 name TEXT NOT NULL
24 );
25 DROP INDEX IF EXISTS products_name;
26 CREATE INDEX products_name ON products (
27 name
28 );
29
30 DROP TABLE IF EXISTS product_file;
31 CREATE TABLE product_file (
32 product INTEGER NOT NULL,
33 file INTEGER NOT NULL,
34 PRIMARY KEY (product, file)
35 );
36
37 DROP TABLE IF EXISTS product_component;
38 CREATE TABLE product_component (
39 product INTEGER NOT NULL,
40 component INTEGER NOT NULL,
41 depth INTEGER DEFAULT 0,
42 sequence INTEGER DEFAULT 0,
43 PRIMARY KEY (product, component)
44 );
45
46 DROP TABLE IF EXISTS file_hashes;
47 CREATE TABLE file_hashes (
48 file INTEGER NOT NULL,
49 directory INTEGER DEFAULT 0,
50 product INTEGER NOT NULL,
51 component INTEGER DEFAULT 0,
52 algo INTEGER NOT NULL,
53 hash BLOB NOT NULL,
54 PRIMARY KEY(file, directory, product, component, algo)
55 );