Store comments on a per-package base basis

Move comments from the Packages table to PackageBases. Sharing comments
makes sense since they almost always refer to a source package.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
This commit is contained in:
Lukas Fleischer 2014-04-04 21:57:01 +02:00
parent b7941073ac
commit d35cf67f7b
4 changed files with 49 additions and 47 deletions

View file

@ -216,7 +216,7 @@ for p in list(seen_pkgs.keys()):
num_comments = random.randrange(PKG_CMNTS[0], PKG_CMNTS[1])
for i in range(0, num_comments):
now = NOW + random.randrange(400, 86400*3)
s = ("INSERT INTO PackageComments (PackageID, UsersID,"
s = ("INSERT INTO PackageComments (PackageBaseID, UsersID,"
" Comments, CommentTS) VALUES (%d, %d, '%s', %d);\n")
s = s % (seen_pkgs[p], genUID(), genFortune(), now)
out.write(s)