# HG changeset patch # User Sylvain Thénault # Date 1271752748 -7200 # Node ID 3e5a256d17baba3edc9f7ce357509989e0e3b476 # Parent 0d9054eb3bd1ea19b4816e863351a0379c305a69 [db-check] fix duplicated schema constraint detection diff -r 0d9054eb3bd1 -r 3e5a256d17ba server/checkintegrity.py --- a/server/checkintegrity.py Mon Apr 19 13:38:46 2010 +0200 +++ b/server/checkintegrity.py Tue Apr 20 10:39:08 2010 +0200 @@ -111,16 +111,16 @@ unique_constraints = ('SizeConstraint', 'FormatConstraint', 'VocabularyConstraint', 'RQLConstraint', 'RQLVocabularyConstraint') - rql = ('Any COUNT(X),RN,EN,ECTN GROUPBY RN,EN,ECTN ORDERBY 1 ' + rql = ('Any COUNT(X),RN,SN,ON,CTN GROUPBY RN,SN,ON,CTN ORDERBY 1 ' 'WHERE X is CWConstraint, R constrained_by X, ' - 'R relation_type RT, R from_entity ET, RT name RN, ' - 'ET name EN, X cstrtype ECT, ECT name ECTN') - for count, rn, en, cstrname in session.execute(rql): + 'R relation_type RT, RT name RN, R from_entity ST, ST name SN, ' + 'R to_entity OT, OT name ON, X cstrtype CT, CT name CTN') + for count, rn, sn, on, cstrname in session.execute(rql): if count == 1: continue if cstrname in unique_constraints: - print "ERROR: got %s %r constraints on relation %s.%s" % ( - count, cstrname, en, rn) + print "ERROR: got %s %r constraints on relation %s.%s.%s" % ( + count, cstrname, sn, rn, on)