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
|
-- This file should be parsable by the brep-migrate utility. To decrease the
-- parser complexity, there is a number of restrictions, see package-extra.sql
-- file for details.
--
-- Increment the database 'build' schema version when update this file, see
-- package-extra.sql file for details.
--
DROP FOREIGN TABLE IF EXISTS build_package_constraints;
DROP FOREIGN TABLE IF EXISTS build_package_builds;
DROP FOREIGN TABLE IF EXISTS build_package_benchmarks;
DROP FOREIGN TABLE IF EXISTS build_package_examples;
DROP FOREIGN TABLE IF EXISTS build_package_tests;
DROP FOREIGN TABLE IF EXISTS build_package;
DROP FOREIGN TABLE IF EXISTS build_repository;
DROP FOREIGN TABLE IF EXISTS build_tenant;
-- The foreign table for build_tenant object.
--
CREATE FOREIGN TABLE build_tenant (
id TEXT NOT NULL,
archived BOOLEAN NOT NULL)
SERVER package_server OPTIONS (table_name 'tenant');
-- The foreign table for build_repository object.
--
CREATE FOREIGN TABLE build_repository (
tenant TEXT NOT NULL,
canonical_name TEXT NOT NULL,
location_url TEXT NOT NULL,
location_type TEXT NOT NULL,
certificate_fingerprint TEXT NULL)
SERVER package_server OPTIONS (table_name 'repository');
-- The foreign table for build_package object.
--
CREATE FOREIGN TABLE build_package (
tenant TEXT NOT NULL,
name CITEXT NOT NULL,
version_epoch INTEGER NOT NULL,
version_canonical_upstream TEXT NOT NULL,
version_canonical_release TEXT NOT NULL COLLATE "C",
version_revision INTEGER NOT NULL,
version_upstream TEXT NOT NULL,
version_release TEXT NULL,
internal_repository_tenant TEXT NULL,
internal_repository_canonical_name TEXT NULL,
buildable BOOLEAN NOT NULL)
SERVER package_server OPTIONS (table_name 'package');
-- The foreign table for the build_package object tests member (that is of a
-- container type).
--
CREATE FOREIGN TABLE build_package_tests (
tenant TEXT NOT NULL,
name CITEXT NOT NULL,
version_epoch INTEGER NOT NULL,
version_canonical_upstream TEXT NOT NULL,
version_canonical_release TEXT NOT NULL COLLATE "C",
version_revision INTEGER NOT NULL,
index BIGINT NOT NULL,
dep_name CITEXT NOT NULL,
dep_package_tenant TEXT NULL,
dep_package_name CITEXT NULL,
dep_package_version_epoch INTEGER NULL,
dep_package_version_canonical_upstream TEXT NULL,
dep_package_version_canonical_release TEXT NULL COLLATE "C",
dep_package_version_revision INTEGER NULL)
SERVER package_server OPTIONS (table_name 'package_tests');
-- The foreign table for the build_package object examples member (that is of a
-- container type).
--
CREATE FOREIGN TABLE build_package_examples (
tenant TEXT NOT NULL,
name CITEXT NOT NULL,
version_epoch INTEGER NOT NULL,
version_canonical_upstream TEXT NOT NULL,
version_canonical_release TEXT NOT NULL COLLATE "C",
version_revision INTEGER NOT NULL,
index BIGINT NOT NULL,
dep_name CITEXT NOT NULL,
dep_package_tenant TEXT NULL,
dep_package_name CITEXT NULL,
dep_package_version_epoch INTEGER NULL,
dep_package_version_canonical_upstream TEXT NULL,
dep_package_version_canonical_release TEXT NULL COLLATE "C",
dep_package_version_revision INTEGER NULL)
SERVER package_server OPTIONS (table_name 'package_examples');
-- The foreign table for the build_package object benchmarks member (that is
-- of a container type).
--
CREATE FOREIGN TABLE build_package_benchmarks (
tenant TEXT NOT NULL,
name CITEXT NOT NULL,
version_epoch INTEGER NOT NULL,
version_canonical_upstream TEXT NOT NULL,
version_canonical_release TEXT NOT NULL COLLATE "C",
version_revision INTEGER NOT NULL,
index BIGINT NOT NULL,
dep_name CITEXT NOT NULL,
dep_package_tenant TEXT NULL,
dep_package_name CITEXT NULL,
dep_package_version_epoch INTEGER NULL,
dep_package_version_canonical_upstream TEXT NULL,
dep_package_version_canonical_release TEXT NULL COLLATE "C",
dep_package_version_revision INTEGER NULL)
SERVER package_server OPTIONS (table_name 'package_benchmarks');
-- The foreign table for the build_package object builds member (that is of a
-- container type).
--
CREATE FOREIGN TABLE build_package_builds (
tenant TEXT NOT NULL,
name CITEXT NOT NULL,
version_epoch INTEGER NOT NULL,
version_canonical_upstream TEXT NOT NULL,
version_canonical_release TEXT NOT NULL COLLATE "C",
version_revision INTEGER NOT NULL,
index BIGINT NOT NULL,
expression TEXT NOT NULL,
comment TEXT NOT NULL)
SERVER package_server OPTIONS (table_name 'package_builds');
-- The foreign table for the build_package object constraints member (that is
-- of a container type).
--
CREATE FOREIGN TABLE build_package_constraints (
tenant TEXT NOT NULL,
name CITEXT NOT NULL,
version_epoch INTEGER NOT NULL,
version_canonical_upstream TEXT NOT NULL,
version_canonical_release TEXT NOT NULL COLLATE "C",
version_revision INTEGER NOT NULL,
index BIGINT NOT NULL,
exclusion BOOLEAN NOT NULL,
config TEXT NOT NULL,
target TEXT NULL,
comment TEXT NOT NULL)
SERVER package_server OPTIONS (table_name 'package_build_constraints');
|