# HG changeset patch # User Sylvain Thénault # Date 1466598943 -7200 # Node ID a702d31ddd8fae8d84c872642969a0b869874969 # Parent e5fe836df6f104865c7613b6fcdbd048f38951b3 [migration] Reserialize all constraints since yams introduce new JSON serializing format So we may drop support for older format in yams at some point. diff -r e5fe836df6f1 -r a702d31ddd8f cubicweb/misc/migration/3.23.0_Any.py --- a/cubicweb/misc/migration/3.23.0_Any.py Thu Jun 23 15:45:30 2016 +0200 +++ b/cubicweb/misc/migration/3.23.0_Any.py Wed Jun 22 14:35:43 2016 +0200 @@ -48,6 +48,8 @@ cwrdef = cwconstraint.reverse_constrained_by[0] rdef = cwrdef.yams_schema() cstr = rdef.constraint_by_eid(cwconstraint.eid) + with cnx.deny_all_hooks_but(): + cwconstraint.cw_set(value=unicode(cstr.serialize())) if cstr.type() not in ('BoundaryConstraint', 'IntervalBoundConstraint', 'StaticVocabularyConstraint'): # These cannot be translate into backend CHECK. @@ -58,4 +60,3 @@ sql('ALTER TABLE cw_%(e)s ADD CONSTRAINT %(c)s CHECK(%(v)s)' % args) commit() -