misc/migration/bootstrapmigration_repository.py
branchstable
changeset 6896 784d5df35af1
parent 6222 21772f4e41d9
child 7398 26695dd703d8
child 7549 465009397d91
--- a/misc/migration/bootstrapmigration_repository.py	Wed Jan 26 10:50:38 2011 +0100
+++ b/misc/migration/bootstrapmigration_repository.py	Wed Jan 26 11:39:21 2011 +0100
@@ -97,6 +97,14 @@
 if applcubicwebversion < (3, 9, 6) and cubicwebversion >= (3, 9, 6):
     add_entity_type('CWUniqueTogetherConstraint')
 
+if not ('CWUniqueTogetherConstraint', 'CWRType') in schema['relations'].rdefs:
+    add_relation_definition('CWUniqueTogetherConstraint', 'relations', 'CWRType')
+    rql('SET C relations RT WHERE C relations RDEF, RDEF relation_type RT')
+    commit()
+    drop_relation_definition('CWUniqueTogetherConstraint', 'relations', 'CWAttribute')
+    drop_relation_definition('CWUniqueTogetherConstraint', 'relations', 'CWRelation')
+
+
 if applcubicwebversion < (3, 4, 0) and cubicwebversion >= (3, 4, 0):
 
     with hooks_control(session, session.HOOKS_ALLOW_ALL, 'integrity'):