server/schemaserial.py
changeset 9964 f4a3ee05cf9d
parent 9963 5531f5577b50
child 9968 50f046bf0e50
--- a/server/schemaserial.py	Thu Aug 28 08:02:15 2014 +0200
+++ b/server/schemaserial.py	Thu Aug 28 07:44:29 2014 +0200
@@ -615,9 +615,13 @@
     yield 'SET %s WHERE X eid %%(x)s' % ','.join(relations), values
 
 def updaterschema2rql(rschema, eid):
-    relations, values = rschema_relations_values(rschema)
-    values['x'] = eid
-    yield 'SET %s WHERE X eid %%(x)s' % ','.join(relations), values
+    if rschema.rule:
+        yield ('SET X rule %(r)s WHERE X eid %(x)s',
+               {'x': eid, 'r': unicode(rschema.rule)})
+    else:
+        relations, values = rschema_relations_values(rschema)
+        values['x'] = eid
+        yield 'SET %s WHERE X eid %%(x)s' % ','.join(relations), values
 
 def updaterdef2rql(rdef, eid):
     relations, values = _rdef_values(rdef)