server/schemaserial.py
changeset 5379 c082dea0731b
parent 4835 13b0b96d7982
child 5423 e15abfdcce38
--- a/server/schemaserial.py	Fri Apr 23 08:48:42 2010 +0200
+++ b/server/schemaserial.py	Fri Apr 23 09:17:07 2010 +0200
@@ -52,7 +52,10 @@
 
 def cstrtype_mapping(cursor):
     """cached constraint types mapping"""
-    return dict(cursor.execute('Any T, X WHERE X is CWConstraintType, X name T'))
+    map = dict(cursor.execute('Any T, X WHERE X is CWConstraintType, X name T'))
+    if not 'BoundConstraint' in map:
+        map['BoundConstraint'] = map['BoundaryConstraint']
+    return map
 
 # schema / perms deserialization ##############################################
 
@@ -240,10 +243,13 @@
     cstrtypemap = {}
     rql = 'INSERT CWConstraintType X: X name %(ct)s'
     for cstrtype in CONSTRAINTS:
+        if cstrtype == 'BoundConstraint':
+            continue # XXX deprecated in yams 0.29 / cw 3.8.1
         cstrtypemap[cstrtype] = execute(rql, {'ct': unicode(cstrtype)},
                                         build_descr=False)[0][0]
         if pb is not None:
             pb.update()
+    cstrtypemap['BoundConstraint'] = cstrtypemap['BoundaryConstraint']
     # serialize relations
     for rschema in schema.relations():
         # skip virtual relations such as eid, has_text and identity