1 DROP DATABASE projectb;
2 CREATE DATABASE projectb;
8 name TEXT UNIQUE NOT NULL,
13 CREATE TABLE component (
14 id SERIAL PRIMARY KEY,
15 name TEXT UNIQUE NOT NULL,
20 CREATE TABLE architecture (
21 id SERIAL PRIMARY KEY,
22 arch_string TEXT UNIQUE NOT NULL,
26 CREATE TABLE maintainer (
27 id SERIAL PRIMARY KEY,
28 name TEXT UNIQUE NOT NULL
31 CREATE TABLE location (
32 id SERIAL PRIMARY KEY,
34 component INT4 REFERENCES component,
35 archive INT4 REFERENCES archive,
39 -- No references below here to allow sane population; added post-population
42 id SERIAL PRIMARY KEY,
43 filename TEXT NOT NULL,
46 location INT4 NOT NULL, -- REFERENCES location
48 unique (filename, location)
52 id SERIAL PRIMARY KEY,
54 version TEXT NOT NULL,
55 maintainer INT4 NOT NULL, -- REFERENCES maintainer
56 file INT4 UNIQUE NOT NULL, -- REFERENCES files
57 unique (source, version)
60 CREATE TABLE dsc_files (
61 id SERIAL PRIMARY KEY,
62 source INT4 NOT NULL, -- REFERENCES source,
63 file INT4 NOT NULL, -- RERENCES files
67 CREATE TABLE binaries (
68 id SERIAL PRIMARY KEY,
69 package TEXT NOT NULL,
70 version TEXT NOT NULL,
71 maintainer INT4 NOT NULL, -- REFERENCES maintainer
72 source INT4, -- REFERENCES source,
73 architecture INT4 NOT NULL, -- REFERENCES architecture
74 file INT4 UNIQUE NOT NULL, -- REFERENCES files,
76 -- joeyh@ doesn't want .udebs and .debs with the same name, which is why the unique () doesn't mention type
77 unique (package, version, architecture)
81 id SERIAL PRIMARY KEY,
82 suite_name TEXT NOT NULL,
83 version TEXT NOT NULL,
90 CREATE TABLE suite_architectures (
91 suite INT4 NOT NULL, -- REFERENCES suite
92 architecture INT4 NOT NULL, -- REFERENCES architecture
93 unique (suite, architecture)
96 CREATE TABLE bin_associations (
97 id SERIAL PRIMARY KEY,
98 suite INT4 NOT NULL, -- REFERENCES suite
99 bin INT4 NOT NULL, -- REFERENCES binaries
103 CREATE TABLE src_associations (
104 id SERIAL PRIMARY KEY,
105 suite INT4 NOT NULL, -- REFERENCES suite
106 source INT4 NOT NULL, -- REFERENCES source
107 unique (suite, source)