932 pending = session.transaction_data.setdefault('pendingrdefs', set()) |
932 pending = session.transaction_data.setdefault('pendingrdefs', set()) |
933 pending.add((subjschema, rschema, objschema)) |
933 pending.add((subjschema, rschema, objschema)) |
934 session.execute('DELETE X %s Y WHERE X is %s, Y is %s' |
934 session.execute('DELETE X %s Y WHERE X is %s, Y is %s' |
935 % (rschema, subjschema, objschema)) |
935 % (rschema, subjschema, objschema)) |
936 execute = session.unsafe_execute |
936 execute = session.unsafe_execute |
|
937 rteid = self.eidto |
937 rset = execute('Any COUNT(X) WHERE X is %s, X relation_type R,' |
938 rset = execute('Any COUNT(X) WHERE X is %s, X relation_type R,' |
938 'R eid %%(x)s' % rdeftype, {'x': rteid}) |
939 'R eid %%(x)s' % rdeftype, {'x': rteid}) |
939 lastrel = rset[0][0] == 0 |
940 lastrel = rset[0][0] == 0 |
940 # we have to update physical schema systematically for final and inlined |
941 # we have to update physical schema systematically for final and inlined |
941 # relations, but only if it's the last instance for this relation type |
942 # relations, but only if it's the last instance for this relation type |