summaryrefslogtreecommitdiffstats
path: root/support
diff options
context:
space:
mode:
Diffstat (limited to 'support')
-rw-r--r--support/schema/aur-schema.sql4
-rwxr-xr-xsupport/schema/gendummydata.py7
2 files changed, 8 insertions, 3 deletions
diff --git a/support/schema/aur-schema.sql b/support/schema/aur-schema.sql
index be1296a..c896aa3 100644
--- a/support/schema/aur-schema.sql
+++ b/support/schema/aur-schema.sql
@@ -104,8 +104,8 @@ CREATE TABLE Packages (
OutOfDateTS BIGINT UNSIGNED NULL DEFAULT NULL,
SubmittedTS BIGINT UNSIGNED NOT NULL,
ModifiedTS BIGINT UNSIGNED NOT NULL,
- SubmitterUID INTEGER UNSIGNED NOT NULL DEFAULT 0, -- who submitted it?
- MaintainerUID INTEGER UNSIGNED NOT NULL DEFAULT 0, -- User
+ SubmitterUID INTEGER UNSIGNED NULL DEFAULT NULL, -- who submitted it?
+ MaintainerUID INTEGER UNSIGNED NULL DEFAULT NULL, -- User
PRIMARY KEY (ID),
UNIQUE (Name),
INDEX (CategoryID),
diff --git a/support/schema/gendummydata.py b/support/schema/gendummydata.py
index e3c14f8..45812a9 100755
--- a/support/schema/gendummydata.py
+++ b/support/schema/gendummydata.py
@@ -228,8 +228,13 @@ for p in seen_pkgs.keys():
uuid = genUID() # the submitter/user
- s = "INSERT INTO Packages (ID, Name, Version, CategoryID, SubmittedTS, SubmitterUID, MaintainerUID) VALUES (%d, '%s', '%s', %d, %d, %d, %d);\n" % (seen_pkgs[p], p, genVersion(),
+ if muid == 0:
+ s = "INSERT INTO Packages (ID, Name, Version, CategoryID, SubmittedTS, SubmitterUID, MaintainerUID) VALUES (%d, '%s', '%s', %d, %d, %d, NULL);\n" % (seen_pkgs[p], p, genVersion(),
+ genCategory(), NOW, uuid)
+ else:
+ s = "INSERT INTO Packages (ID, Name, Version, CategoryID, SubmittedTS, SubmitterUID, MaintainerUID) VALUES (%d, '%s', '%s', %d, %d, %d, %d);\n" % (seen_pkgs[p], p, genVersion(),
genCategory(), NOW, uuid, muid)
+
out.write(s)
if count % 100 == 0:
if DBUG: print ".",