misc/migration/3.11.0_Any.py
author Sylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 09 Apr 2014 17:14:25 +0200
changeset 9749 dbaf79418b8f
parent 9450 af4b93bc38a5
permissions -rw-r--r--
[repo] fix extid2entity to ensure connection's has a cnxset else we'll call source.doexec, which attempt to access to cnxset.cu, and crash in some case (eg unittest_cwxmlparser in sobjects/test). Also, manually switch to 'write' mode to ensure cnxset is not released until commit/rollback when some entity is inserted.

from datetime import datetime

for rtype in ('cw_support', 'cw_dont_cross', 'cw_may_cross'):
    drop_relation_type(rtype)

add_entity_type('CWSourceSchemaConfig')

if not 'url' in schema['CWSource'].subjrels:
    add_attribute('CWSource', 'url')
    add_attribute('CWSource', 'parser')
    add_attribute('CWSource', 'latest_retrieval')