mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
gendummydata.py: Fix NOT NULL constraint problems
PackageBases.FlaggerComment and PackageComments.RenderedComment cannot be NULL and would cause problems in the output file for sqlite users. This patch adds empty strings ("") as values for these fields. Signed-off-by: Mark Weiman <mark.weiman@markzz.com> Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
This commit is contained in:
parent
a8ac2004d3
commit
0c6a415cb3
1 changed files with 3 additions and 3 deletions
|
@ -205,8 +205,8 @@ for p in list(seen_pkgs.keys()):
|
||||||
|
|
||||||
uuid = genUID() # the submitter/user
|
uuid = genUID() # the submitter/user
|
||||||
|
|
||||||
s = ("INSERT INTO PackageBases (ID, Name, SubmittedTS, ModifiedTS, "
|
s = ("INSERT INTO PackageBases (ID, Name, FlaggerComment, SubmittedTS, ModifiedTS, "
|
||||||
"SubmitterUID, MaintainerUID, PackagerUID) VALUES (%d, '%s', %d, %d, %d, %s, %s);\n")
|
"SubmitterUID, MaintainerUID, PackagerUID) VALUES (%d, '%s', '', %d, %d, %d, %s, %s);\n")
|
||||||
s = s % (seen_pkgs[p], p, NOW, NOW, uuid, muid, puid)
|
s = s % (seen_pkgs[p], p, NOW, NOW, uuid, muid, puid)
|
||||||
out.write(s)
|
out.write(s)
|
||||||
|
|
||||||
|
@ -223,7 +223,7 @@ for p in list(seen_pkgs.keys()):
|
||||||
for i in range(0, num_comments):
|
for i in range(0, num_comments):
|
||||||
now = NOW + random.randrange(400, 86400*3)
|
now = NOW + random.randrange(400, 86400*3)
|
||||||
s = ("INSERT INTO PackageComments (PackageBaseID, UsersID,"
|
s = ("INSERT INTO PackageComments (PackageBaseID, UsersID,"
|
||||||
" Comments, CommentTS) VALUES (%d, %d, '%s', %d);\n")
|
" Comments, RenderedComment, CommentTS) VALUES (%d, %d, '%s', '', %d);\n")
|
||||||
s = s % (seen_pkgs[p], genUID(), genFortune(), now)
|
s = s % (seen_pkgs[p], genUID(), genFortune(), now)
|
||||||
out.write(s)
|
out.write(s)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue