X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=setup%2Finit_pool.sql;h=bbb82e7415e60a7f24da35840f133ee235568779;hb=3b1f0efc3965793443da9260e8f80f895b7dccd1;hp=8797acd59b33c4c6b88c2ac6f4edbdef1459baa8;hpb=ea17738cea735d71766bfc2bd082f59b3adf2dbb;p=dak.git diff --git a/setup/init_pool.sql b/setup/init_pool.sql index 8797acd5..bbb82e74 100644 --- a/setup/init_pool.sql +++ b/setup/init_pool.sql @@ -38,6 +38,7 @@ CREATE TABLE uid ( id SERIAL PRIMARY KEY, uid TEXT UNIQUE NOT NULL, name TEXT + debian_maintainer BOOLEAN NOT NULL, ); CREATE TABLE keyrings ( @@ -70,6 +71,8 @@ CREATE TABLE files ( md5sum TEXT NOT NULL, location INT4 NOT NULL, -- REFERENCES location last_used TIMESTAMP, + sha1sum TEXT NOT NULL, + sha256sum TEXT NOT NULL, unique (filename, location) ); @@ -78,12 +81,20 @@ CREATE TABLE source ( source TEXT NOT NULL, version TEXT NOT NULL, maintainer INT4 NOT NULL, -- REFERENCES maintainer + changedby INT4 NOT NULL, -- REFERENCES maintainer file INT4 UNIQUE NOT NULL, -- REFERENCES files install_date TIMESTAMP NOT NULL, sig_fpr INT4 NOT NULL, -- REFERENCES fingerprint + dm-upload-allowed BOOLEAN NOT NULL, unique (source, version) ); +CREATE TABLE src_uploaders ( + id SERIAL PRIMARY KEY, + source INT4 NOT NULL REFERENCES source, + maintainer INT4 NOT NULL REFERENCES maintainer +); + CREATE TABLE dsc_files ( id SERIAL PRIMARY KEY, source INT4 NOT NULL, -- REFERENCES source, @@ -184,3 +195,19 @@ 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); + +-- Own function +CREATE FUNCTION space_concat(text, text) RETURNS text + AS $_$select case +WHEN $2 is null or $2 = '' THEN $1 +WHEN $1 is null or $1 = '' THEN $2 +ELSE $1 || ' ' || $2 +END$_$ + LANGUAGE sql; + +CREATE AGGREGATE space_separated_list ( + BASETYPE = text, + SFUNC = space_concat, + STYPE = text, + INITCOND = '' +);