hooks/syncschema.py
changeset 10816 d4a26e94f54a
parent 10813 ab626726a70a
child 10916 8e504786df3c
equal deleted inserted replaced
10815:bc679f7e96d8 10816:d4a26e94f54a
   716             self.size_cstr_changed = True
   716             self.size_cstr_changed = True
   717         elif cstrtype == 'UniqueConstraint':
   717         elif cstrtype == 'UniqueConstraint':
   718             syssource.update_rdef_unique(cnx, rdef)
   718             syssource.update_rdef_unique(cnx, rdef)
   719             self.unique_changed = True
   719             self.unique_changed = True
   720         if cstrtype in ('BoundaryConstraint', 'IntervalBoundConstraint', 'StaticVocabularyConstraint'):
   720         if cstrtype in ('BoundaryConstraint', 'IntervalBoundConstraint', 'StaticVocabularyConstraint'):
   721             cstrname = 'cstr' + md5(rdef.subject.type + rdef.rtype.type + cstrtype +
   721             cstrname = 'cstr' + md5((rdef.subject.type + rdef.rtype.type + cstrtype +
   722                                     (self.oldcstr.serialize() or '')).hexdigest()
   722                                      (self.oldcstr.serialize() or '')).encode('utf-8')).hexdigest()
   723             cnx.system_sql('ALTER TABLE %s%s DROP CONSTRAINT %s' % (SQL_PREFIX, rdef.subject.type, cstrname))
   723             cnx.system_sql('ALTER TABLE %s%s DROP CONSTRAINT %s' % (SQL_PREFIX, rdef.subject.type, cstrname))
   724 
   724 
   725     def revertprecommit_event(self):
   725     def revertprecommit_event(self):
   726         # revert changes on in memory schema
   726         # revert changes on in memory schema
   727         if self.newcstr is not None:
   727         if self.newcstr is not None: