X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=init_pool.sql;h=093e029139f8ab3c0b01b16f2addfe1a34a4b356;hb=6cc79b7b093af0c68c9d80c61d5aa7cfe72c9188;hp=781737cb7fa31cf6de28c1d381f2737d6d95c81c;hpb=15046787dd73ccc528fbae8a89bdec63507f2bb9;p=dak.git diff --git a/init_pool.sql b/init_pool.sql index 781737cb..093e0291 100644 --- a/init_pool.sql +++ b/init_pool.sql @@ -1,5 +1,5 @@ DROP DATABASE projectb; -CREATE DATABASE projectb; +CREATE DATABASE projectb WITH ENCODING = 'SQL_ASCII'; \c projectb @@ -24,10 +24,21 @@ CREATE TABLE architecture ( ); CREATE TABLE maintainer ( - id SERIAL PRIMARY KEY, + id SERIAL PRIMARY KEY, name TEXT UNIQUE NOT NULL ); +CREATE TABLE uid ( + id SERIAL PRIMARY KEY, + uid TEXT UNIQUE NOT NULL +); + +CREATE TABLE fingerprint ( + id SERIAL PRIMARY KEY, + fingerprint TEXT UNIQUE NOT NULL, + uid INT4 REFERENCES uid +); + CREATE TABLE location ( id SERIAL PRIMARY KEY, path TEXT NOT NULL, @@ -54,6 +65,8 @@ CREATE TABLE source ( version TEXT NOT NULL, maintainer INT4 NOT NULL, -- REFERENCES maintainer file INT4 UNIQUE NOT NULL, -- REFERENCES files + install_date TIMESTAMP NOT NULL, + sig_fpr INT4 NOT NULL, -- REFERENCES fingerprint unique (source, version) ); @@ -74,25 +87,26 @@ 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 + sig_fpr INT4 NOT NULL, -- REFERENCES fingerprint unique (package, version, architecture) ); CREATE TABLE suite ( id SERIAL PRIMARY KEY, suite_name TEXT NOT NULL, - version TEXT NOT NULL, + version TEXT, origin TEXT, label TEXT, policy_engine TEXT, description TEXT ); - + CREATE TABLE suite_architectures ( suite INT4 NOT NULL, -- REFERENCES suite architecture INT4 NOT NULL, -- REFERENCES architecture unique (suite, architecture) ); - + CREATE TABLE bin_associations ( id SERIAL PRIMARY KEY, suite INT4 NOT NULL, -- REFERENCES suite @@ -124,7 +138,7 @@ CREATE TABLE override_type ( ); CREATE TABLE override ( - package TEXT NOT NULL, + package TEXT NOT NULL, suite INT4 NOT NULL, -- references suite component INT4 NOT NULL, -- references component priority INT4, -- references priority @@ -134,7 +148,19 @@ CREATE TABLE override ( unique (suite, component, package, type) ); +CREATE TABLE accepted_autobuild ( + suite INT4 NOT NULL, -- references suite + filename TEXT NOT NULL, + in_accepted BOOLEAN NOT NULL, + last_used TIMESTAMP +); + -- 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 binaries_fingerprint on binaries (sig_fpr); +CREATE INDEX source_fingerprint on source (sig_fpr); +CREATE INDEX dsc_files_file ON dsc_files (file);