-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpulpdb.sql
More file actions
54 lines (40 loc) · 1.21 KB
/
pulpdb.sql
File metadata and controls
54 lines (40 loc) · 1.21 KB
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
CREATE USER pulpdb WITH PASSWORD 'pulpdb';
CREATE DATABASE pulpdb;
GRANT ALL PRIVILEGES ON DATABASE pulpdb to pulpdb;
CREATE TABLE rpms (
rpm_id SERIAL PRIMARY KEY,
name char(100) NOT NULL,
bigname char(310) UNIQUE NOT NULL,
ver char(100) NOT NULL,
rel char(100) NOT NULL,
arch char(10) NOT NULL,
path char(400) NOT NULL,
UNIQUE (name, ver, rel, arch)
);
CREATE TABLE repos (
repo_id SERIAL PRIMARY KEY,
name char(200) UNIQUE NOT NULL,
repoid char(100) UNIQUE NOT NULL
);
CREATE TABLE rpms_repos (
rpm_id integer NOT NULL REFERENCES rpms,
repo_id integer NOT NULL REFERENCES repos
);
CREATE TABLE cvs (
cv_id SERIAL PRIMARY KEY,
name char(100) NOT NULL,
latest_ver integer
);
CREATE TABLE cvvers (
cvver_id SERIAL PRIMARY KEY,
cv_id integer NOT NULL REFERENCES cvs,
ver integer NOT NULL
);
CREATE TABLE repo_mvs (
mat_view char(100) PRIMARY KEY,
cvver_id integer NOT NULL REFERENCES cvvers
);
CREATE TABLE cvs_repos (
cv_id integer NOT NULL REFERENCES cvs,
repo_id integer NOT NULL REFERENCES repos
);