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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
|
/* This file was generated by ODB, object-relational mapping (ORM)
* compiler for C++.
*/
DROP TABLE IF EXISTS "build_delay" CASCADE;
DROP TABLE IF EXISTS "build_results" CASCADE;
DROP TABLE IF EXISTS "build" CASCADE;
DROP TABLE IF EXISTS "schema_version";
CREATE TABLE "build" (
"package_tenant" TEXT NOT NULL,
"package_name" CITEXT NOT NULL,
"package_version_epoch" INTEGER NOT NULL,
"package_version_canonical_upstream" TEXT NOT NULL,
"package_version_canonical_release" TEXT NOT NULL COLLATE "C",
"package_version_revision" INTEGER NOT NULL,
"configuration" TEXT NOT NULL,
"toolchain_name" TEXT NOT NULL,
"toolchain_version_epoch" INTEGER NOT NULL,
"toolchain_version_canonical_upstream" TEXT NOT NULL,
"toolchain_version_canonical_release" TEXT NOT NULL COLLATE "C",
"toolchain_version_revision" INTEGER NOT NULL,
"package_version_upstream" TEXT NOT NULL,
"package_version_release" TEXT NULL,
"toolchain_version_upstream" TEXT NOT NULL,
"toolchain_version_release" TEXT NULL,
"state" TEXT NOT NULL,
"timestamp" BIGINT NOT NULL,
"force" TEXT NOT NULL,
"status" TEXT NULL,
"completion_timestamp" BIGINT NOT NULL DEFAULT 0,
"agent_fingerprint" TEXT NULL,
"agent_challenge" TEXT NULL,
"machine" TEXT NOT NULL,
"machine_summary" TEXT NOT NULL,
"target" TEXT NOT NULL,
PRIMARY KEY ("package_tenant",
"package_name",
"package_version_epoch",
"package_version_canonical_upstream",
"package_version_canonical_release",
"package_version_revision",
"configuration",
"toolchain_name",
"toolchain_version_epoch",
"toolchain_version_canonical_upstream",
"toolchain_version_canonical_release",
"toolchain_version_revision"));
CREATE INDEX "build_timestamp_i"
ON "build" ("timestamp");
CREATE TABLE "build_results" (
"package_tenant" TEXT NOT NULL,
"package_name" CITEXT NOT NULL,
"package_version_epoch" INTEGER NOT NULL,
"package_version_canonical_upstream" TEXT NOT NULL,
"package_version_canonical_release" TEXT NOT NULL COLLATE "C",
"package_version_revision" INTEGER NOT NULL,
"configuration" TEXT NOT NULL,
"toolchain_name" TEXT NOT NULL,
"toolchain_version_epoch" INTEGER NOT NULL,
"toolchain_version_canonical_upstream" TEXT NOT NULL,
"toolchain_version_canonical_release" TEXT NOT NULL COLLATE "C",
"toolchain_version_revision" INTEGER NOT NULL,
"index" BIGINT NOT NULL,
"operation" TEXT NOT NULL,
"status" TEXT NOT NULL,
"log" TEXT NOT NULL,
CONSTRAINT "object_id_fk"
FOREIGN KEY ("package_tenant",
"package_name",
"package_version_epoch",
"package_version_canonical_upstream",
"package_version_canonical_release",
"package_version_revision",
"configuration",
"toolchain_name",
"toolchain_version_epoch",
"toolchain_version_canonical_upstream",
"toolchain_version_canonical_release",
"toolchain_version_revision")
REFERENCES "build" ("package_tenant",
"package_name",
"package_version_epoch",
"package_version_canonical_upstream",
"package_version_canonical_release",
"package_version_revision",
"configuration",
"toolchain_name",
"toolchain_version_epoch",
"toolchain_version_canonical_upstream",
"toolchain_version_canonical_release",
"toolchain_version_revision")
ON DELETE CASCADE);
CREATE INDEX "build_results_object_id_i"
ON "build_results" (
"package_tenant",
"package_name",
"package_version_epoch",
"package_version_canonical_upstream",
"package_version_canonical_release",
"package_version_revision",
"configuration",
"toolchain_name",
"toolchain_version_epoch",
"toolchain_version_canonical_upstream",
"toolchain_version_canonical_release",
"toolchain_version_revision");
CREATE INDEX "build_results_index_i"
ON "build_results" ("index");
CREATE TABLE "build_delay" (
"package_tenant" TEXT NOT NULL,
"package_name" CITEXT NOT NULL,
"package_version_epoch" INTEGER NOT NULL,
"package_version_canonical_upstream" TEXT NOT NULL,
"package_version_canonical_release" TEXT NOT NULL COLLATE "C",
"package_version_revision" INTEGER NOT NULL,
"configuration" TEXT NOT NULL,
"toolchain_name" TEXT NOT NULL,
"toolchain_version_epoch" INTEGER NOT NULL,
"toolchain_version_canonical_upstream" TEXT NOT NULL,
"toolchain_version_canonical_release" TEXT NOT NULL COLLATE "C",
"toolchain_version_revision" INTEGER NOT NULL,
"package_version_upstream" TEXT NOT NULL,
"package_version_release" TEXT NULL,
"toolchain_version_upstream" TEXT NOT NULL,
"toolchain_version_release" TEXT NULL,
"report_timestamp" BIGINT NOT NULL,
"package_timestamp" BIGINT NOT NULL,
PRIMARY KEY ("package_tenant",
"package_name",
"package_version_epoch",
"package_version_canonical_upstream",
"package_version_canonical_release",
"package_version_revision",
"configuration",
"toolchain_name",
"toolchain_version_epoch",
"toolchain_version_canonical_upstream",
"toolchain_version_canonical_release",
"toolchain_version_revision"));
CREATE TABLE "schema_version" (
"name" TEXT NOT NULL PRIMARY KEY,
"version" BIGINT NOT NULL,
"migration" BOOLEAN NOT NULL);
INSERT INTO "schema_version" (
"name", "version", "migration")
VALUES ('build', 12, FALSE);
|