X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=init_pool.sql;h=7676f7c07490de5d7d3ab7417fc8c30d62ddc81b;hb=ec1a67974741109d20ca943f324c02bc34a5f21e;hp=e7bfb87da1c89950b7833b31014476e97a46f689;hpb=07241fcd65bb2808804fe2a6e53807997ee9025b;p=dak.git diff --git a/init_pool.sql b/init_pool.sql index e7bfb87d..7676f7c0 100644 --- a/init_pool.sql +++ b/init_pool.sql @@ -74,7 +74,7 @@ CREATE TABLE binaries ( file INT4 UNIQUE NOT NULL, -- REFERENCES files, type TEXT NOT NULL, -- joeyh@ doesn't want .udebs and .debs with the same name, which is why the unique () doesn't mention type - unique (package, version, source, architecture) + unique (package, version, architecture) ); CREATE TABLE suite ( @@ -106,3 +106,38 @@ CREATE TABLE src_associations ( source INT4 NOT NULL, -- REFERENCES source unique (suite, source) ); + +CREATE TABLE section ( + id SERIAL PRIMARY KEY, + section TEXT UNIQUE NOT NULL +); + +CREATE TABLE priority ( + id SERIAL PRIMARY KEY, + priority TEXT UNIQUE NOT NULL, + level INT4 UNIQUE NOT NULL +); + +CREATE TABLE override_type ( + id SERIAL PRIMARY KEY, + type TEXT UNIQUE NOT NULL +); + +CREATE TABLE override ( + package TEXT NOT NULL, + suite INT4 NOT NULL, -- references suite + component INT4 NOT NULL, -- references component + priority INT4, -- references priority + section INT4 NOT NULL, -- references section + type INT4 NOT NULL, -- references override_type + maintainer TEXT, + unique (suite, component, package, type) +); + +-- Critical indexes + +CREATE INDEX bin_associations_bin ON bin_associations (bin); +CREATE INDEX src_associations_source ON src_associations (source); +CREATE INDEX source_maintainer ON source (maintainer); +CREATE INDEX binaries_maintainer ON binaries (maintainer); +CREATE INDEX dsc_files_file ON dsc_files (file);