[migration] Reserialize all constraints since yams introduce new JSON serializing format
So we may drop support for older format in yams at some point.
--- 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()
-