cubicweb/misc/migration/3.10.4_Any.py
author Laurent Peuch <cortex@worlddomination.be>
Tue, 17 Dec 2019 16:56:23 +0100
changeset 12820 da416fb21657
parent 11057 0b59724cb3f2
permissions -rw-r--r--
[test/fix] prevent FirefoxHelper from silently failing to start This was breaking some tests without any obvious error message and you should fail as early as possible to make debugging easier. Closes #17260390

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()