b7b430b3c7606b17d8424ace57d77a081f8c6cd3
[strongswan.git] / sw_collector_tables.sql
1 /* SQLit database for an Endpoint Collector */
2
3 DROP TABLE IF EXISTS "events";
4 CREATE TABLE "events" (
5 "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
6 "epoch" INTEGER NOT NULL,
7 "timestamp" CHAR(20) NOT NULL
8 );
9
10 DROP TABLE IF EXISTS "sw_identifiers";
11 CREATE TABLE "sw_identifiers" (
12 "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
13 "name" VARCHAR(255) NOT NULL,
14 "package" VARCHAR(255) NOT NULL,
15 "version" VARCHAR(255) NOT NULL,
16 "source" INTEGER DEFAULT 0,
17 "installed" INTEGER DEFAULT 1,
18 "tag" TEXT
19 );
20 DROP INDEX IF EXISTS "sw_identifiers_name";
21 CREATE INDEX "sw_identifiers_name" ON "sw_identifiers" (
22 "name"
23 );
24
25 DROP TABLE IF EXISTS "sw_events";
26 CREATE TABLE "sw_events" (
27 "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
28 "eid" INTEGER REFERENCES "events" ("id"),
29 "sw_id" INTEGER NOT NULL REFERENCES "sw_identifiers" ("id"),
30 "action" INTEGER NOT NULL
31 );