# HG changeset patch # User Julien Cristau # Date 1443013315 -7200 # Node ID 22f330f829ae04c1b2a2b8f0f1e98f8a42716c74 # Parent 80236876ee4dd09d8a04a6909335b978f2ec0bfa [hooks/syncschema] make sure CWUniqueTogetherConstraintDelOp happens before CWConstraintDelOp SQLServer refuses to index an unlimited text column, so we should drop unique_together constraints (which imply an index) before we drop size constraints. Closes #5560601. diff -r 80236876ee4d -r 22f330f829ae hooks/syncschema.py --- a/hooks/syncschema.py Wed Sep 23 15:00:33 2015 +0200 +++ b/hooks/syncschema.py Wed Sep 23 15:01:55 2015 +0200 @@ -750,6 +750,13 @@ entity = cstrname = None # for pylint cols = () # for pylint + def insert_index(self): + # We need to run before CWConstraintDelOp: if a size constraint is + # removed and the column is part of a unique_together constraint, we + # remove the unique_together index before changing the column's type. + # SQL Server does not support unique indices on unlimited text columns. + return 0 + def precommit_event(self): cnx = self.cnx prefix = SQL_PREFIX