[schemaserial] be robust against duplicated CWUniqueTogetherConstrain entities arising from bug in the pre 3.18 era
Closes #4619278.
--- a/server/schemaserial.py Mon Feb 17 15:01:23 2014 +0100
+++ b/server/schemaserial.py Mon Nov 24 12:36:17 2014 +0100
@@ -427,7 +427,14 @@
def uniquetogether2rqls(eschema):
rql_args = []
+ # robustness against duplicated CWUniqueTogetherConstraint (pre 3.18)
+ columnset = set()
for columns in eschema._unique_together:
+ if columns in columnset:
+ print ('schemaserial: skipping duplicate unique together %r %r' %
+ (eschema.type, columns))
+ continue
+ columnset.add(columns)
rql, args = _uniquetogether2rql(eschema, columns)
args['name'] = y2sql.unique_index_name(eschema, columns)
rql_args.append((rql, args))