+2008-02-09 Christoph Berg <myon@debian.org>
+
+ * setup/add_constraints.sql setup/init_pool.sql: Add changedby column
+ to source table, and move src_uploaders after source so the REFERNCES
+ clause works.
+ * dak/process_accepted.py (install): Fill the changedby column from
+ the information found in the .changes. This will allow to identify
+ NMUs and sponsored uploads more precisely in tools querying projectb.
+
2008-02-06 Joerg Jaspert <joerg@debian.org>
* daklib/utils.py (check_signature): Make variable key available,
maintainer = dsc["maintainer"]
maintainer = maintainer.replace("'", "\\'")
maintainer_id = daklib.database.get_or_set_maintainer_id(maintainer)
+ changedby = changes["changed-by"]
+ changedby = changedby.replace("'", "\\'")
+ changedby_id = daklib.database.get_or_set_maintainer_id(changedby)
fingerprint_id = daklib.database.get_or_set_fingerprint_id(dsc["fingerprint"])
install_date = time.strftime("%Y-%m-%d")
filename = files[file]["pool name"] + file
dsc_location_id = files[file]["location id"]
if not files[file].has_key("files id") or not files[file]["files id"]:
files[file]["files id"] = daklib.database.set_files_id (filename, files[file]["size"], files[file]["md5sum"], dsc_location_id)
- projectB.query("INSERT INTO source (source, version, maintainer, file, install_date, sig_fpr) VALUES ('%s', '%s', %d, %d, '%s', %s)"
- % (package, version, maintainer_id, files[file]["files id"], install_date, fingerprint_id))
+ projectB.query("INSERT INTO source (source, version, maintainer, changedby, file, install_date, sig_fpr) VALUES ('%s', '%s', %d, %d, %d, '%s', %s)"
+ % (package, version, maintainer_id, changedby_id, files[file]["files id"], install_date, fingerprint_id))
for suite in changes["distribution"].keys():
suite_id = daklib.database.get_suite_id(suite)
ALTER TABLE files ADD CONSTRAINT files_location FOREIGN KEY (location) REFERENCES location(id) MATCH FULL;
ALTER TABLE source ADD CONSTRAINT source_maintainer FOREIGN KEY (maintainer) REFERENCES maintainer(id) MATCH FULL;
+ALTER TABLE source ADD CONSTRAINT source_changedby FOREIGN KEY (changedby) REFERENCES maintainer(id) MATCH FULL;
ALTER TABLE source ADD CONSTRAINT source_file FOREIGN KEY (file) REFERENCES files(id) MATCH FULL;
ALTER TABLE source ADD CONSTRAINT source_sig_fpr FOREIGN KEY (sig_fpr) REFERENCES fingerprint(id) MATCH FULL;
name TEXT UNIQUE NOT NULL
);
-CREATE TABLE src_uploaders (
- id SERIAL PRIMARY KEY,
- source INT4 NOT NULL REFERENCES source,
- maintainer INT4 NOT NULL REFERENCES maintainer
-);
-
CREATE TABLE uid (
id SERIAL PRIMARY KEY,
uid TEXT UNIQUE NOT NULL,
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
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,