[Collab-qa-commits] r1095 - in udd/src: schema udd
neronus-guest at alioth.debian.org
neronus-guest at alioth.debian.org
Thu Aug 14 12:11:42 UTC 2008
Author: neronus-guest
Date: 2008-08-14 12:11:41 +0000 (Thu, 14 Aug 2008)
New Revision: 1095
Modified:
udd/src/schema/upload_history
udd/src/udd/upload_history_gatherer.py
Log:
fixed foreign keys
Modified: udd/src/schema/upload_history
===================================================================
--- udd/src/schema/upload_history 2008-08-14 11:59:26 UTC (rev 1094)
+++ udd/src/schema/upload_history 2008-08-14 12:11:41 UTC (rev 1095)
@@ -1,13 +1,14 @@
CREATE TABLE %(table)s
(id serial, package text, version text, date timestamp with time zone,
- changed_by text, maintainer text, nmu boolean, signed_by text, key_id text);
+ changed_by text, maintainer text, nmu boolean, signed_by text, key_id text,
+ PRIMARY KEY (id));
CREATE TABLE %(table)s_architecture
- (id int FOREIGN KEY %(table)s, architecture text,
+ (id int REFERENCES %(table)s, architecture text,
PRIMARY KEY (id, architecture));
CREATE TABLE %(table)s_closes
- (id int FOREIGN KEY %(table)s, bug int,
+ (id int REFERENCES %(table)s, bug int,
PRIMARY KEY (id, bug));
GRANT SELECT ON %(table)s TO PUBLIC;
Modified: udd/src/udd/upload_history_gatherer.py
===================================================================
--- udd/src/udd/upload_history_gatherer.py 2008-08-14 11:59:26 UTC (rev 1094)
+++ udd/src/udd/upload_history_gatherer.py 2008-08-14 12:11:41 UTC (rev 1095)
@@ -1,4 +1,4 @@
-# Last-Modified: <Tue Aug 12 16:01:29 2008>
+# Last-Modified: <Thu Aug 14 12:06:50 2008>
# This file is part of the Ultimate Debian Database Project
from gatherer import gatherer
@@ -58,6 +58,9 @@
# Stupid multi-line maintainer fields *grml*
if line == '':
try:
+ query = "EXECUTE uh_insert(%(id)s, %(Source)s, %(Version)s, %(Date)s, %(Changed-By)s, \
+ %(Maintainer)s, %(NMU)s, %(Key)s, %(Signed-By)s)"
+ cursor.execute(query, current)
for arch in set(current['Architecture'].split()):
current['arch'] = arch
query = "EXECUTE uh_arch_insert(%(id)s, %(arch)s)"
@@ -67,9 +70,6 @@
current['closes'] = closes
query = "EXECUTE uh_close_insert(%(id)s, %(closes)s)"
cursor.execute(query, current)
- query = "EXECUTE uh_insert(%(id)s, %(Source)s, %(Version)s, %(Date)s, %(Changed-By)s, \
- %(Maintainer)s, %(NMU)s, %(Key)s, %(Signed-By)s)"
- cursor.execute(query, current)
except psycopg2.ProgrammingError, s:
print "Error at line %d of file %s" % (line_count, name)
continue
More information about the Collab-qa-commits
mailing list