564914e786f8174f1df416f4a414a95aafd88964
[strongswan.git] / src / libpts / 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 );
9
10 DROP TABLE IF EXISTS components;
11 CREATE TABLE components (
12 id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
13 vendor_id INTEGER NOT NULL,
14 name INTEGER NOT NULL,
15 qualifier INTEGER DEFAULT 0
16 );
17
18 DROP TABLE IF EXISTS products;
19 CREATE TABLE products (
20 id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
21 name TEXT NOT NULL
22 );
23 DROP INDEX IF EXISTS products_name;
24 CREATE INDEX products_name ON products (
25 name
26 );
27
28 DROP TABLE IF EXISTS product_file;
29 CREATE TABLE product_file (
30 product INTEGER NOT NULL,
31 file INTEGER NOT NULL,
32 measurement INTEGER DEFAULT 0,
33 metadata INTEGER DEFAULT 0,
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 seq_no 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 algo INTEGER NOT NULL,
52 hash BLOB NOT NULL,
53 PRIMARY KEY(file, directory, product, algo)
54 );
55
56 DROP TABLE IF EXISTS component_hashes;
57 CREATE TABLE component_hashes (
58 component INTEGER NOT NULL,
59 product INTEGER NOT NULL,
60 seq_no INTEGER NOT NULL,
61 pcr INTEGER NOT NULL,
62 algo INTEGER NOT NULL,
63 hash BLOB NOT NULL,
64 PRIMARY KEY(component, product, seq_no, algo)
65 );