[migration/3.21] fix stupid error in migration script
str.join doesn't like a list of ints. Closes #5706359.
--- a/misc/migration/3.21.0_Any.py Wed Jul 15 15:01:21 2015 +0200
+++ b/misc/migration/3.21.0_Any.py Mon Jul 20 16:43:47 2015 +0200
@@ -50,13 +50,13 @@
broken_eids = sql('SELECT cw_eid FROM cw_%(e)s WHERE cw_%(r)s IS NULL' % args, ask_confirm=False)
if broken_eids:
print 'Required relation %(e)s.%(r)s missing' % args
- args['eids'] = ', '.join(eid for eid, in broken_eids)
+ args['eids'] = ', '.join(str(eid) for eid, in broken_eids)
rql('DELETE %(e)s X WHERE X eid IN (%(eids)s)' % args)
broken_eids = sql('SELECT cw_eid FROM cw_%(e)s WHERE cw_%(r)s IN (SELECT cw_%(r)s FROM cw_%(e)s '
'EXCEPT SELECT eid FROM entities)' % args, ask_confirm=False)
if broken_eids:
print 'Required relation %(e)s.%(r)s references unknown objects, deleting subject entities' % args
- args['eids'] = ', '.join(eid for eid, in broken_eids)
+ args['eids'] = ', '.join(str(eid) for eid, in broken_eids)
rql('DELETE %(e)s X WHERE X eid IN (%(eids)s)' % args)
else:
if sql('SELECT COUNT(*) FROM ('