misc/migration/3.10.4_Any.py
author Alexandre Fayolle <alexandre.fayolle@logilab.fr>
Wed, 20 Apr 2011 16:55:52 +0200
changeset 7238 576abb8c4626
parent 6702 dfc19a6fb8aa
permissions -rw-r--r--
fix implementation of repository.glob_add_relations (closes ##1625257) the internal data structure had changed during implementation and the code had not been updated...

for eschema in schema.entities():
    if not (eschema.final or 'cw_source' in eschema.subjrels):
        add_relation_definition(eschema.type, 'cw_source', 'CWSource', ask_confirm=False)

sql('INSERT INTO cw_source_relation(eid_from, eid_to) '
    'SELECT e.eid,s.cw_eid FROM entities as e, cw_CWSource as s '
    'WHERE s.cw_name=e.source AND NOT EXISTS(SELECT 1 FROM cw_source_relation WHERE eid_from=e.eid AND eid_to=s.cw_eid)')
commit()