server/migractions.py
changeset 10129 52adf66fae7d
parent 10107 1ef92a6193a8
child 10200 cceb2c7c02f4
child 10284 fb113f9fa7d8
--- a/server/migractions.py	Fri Dec 19 12:39:42 2014 +0100
+++ b/server/migractions.py	Mon Dec 22 14:39:50 2014 +0100
@@ -1061,12 +1061,9 @@
 
     def cmd_drop_relation_type(self, rtype, commit=True):
         """unregister an existing relation type"""
-        rschema = self.repo.schema[rtype]
-        if rschema.rule:
-            etype = 'CWComputedRType'
-        else:
-            etype = 'CWRType'
-        self.rqlexec('DELETE %s X WHERE X name %r' % (etype, rtype),
+        self.rqlexec('DELETE CWRType X WHERE X name %r' % rtype,
+                     ask_confirm=self.verbosity>=2)
+        self.rqlexec('DELETE CWComputedRType X WHERE X name %r' % rtype,
                      ask_confirm=self.verbosity>=2)
         if commit:
             self.commit()