misc/migration/postcreate.py
changeset 11075 881b3d9ee2b3
parent 10817 7b154e0fa194
equal deleted inserted replaced
11074:76d06973776e 11075:881b3d9ee2b3
    28               value=text_type(config.cubicweb_version()))
    28               value=text_type(config.cubicweb_version()))
    29 for cube in config.cubes():
    29 for cube in config.cubes():
    30     create_entity('CWProperty', pkey=u'system.version.%s' % cube.lower(),
    30     create_entity('CWProperty', pkey=u'system.version.%s' % cube.lower(),
    31                   value=text_type(config.cube_version(cube)))
    31                   value=text_type(config.cube_version(cube)))
    32 
    32 
    33 # some entities have been added before schema entities, fix the 'is' and
    33 # some entities have been added before schema entities, add their missing 'is' and
    34 # 'is_instance_of' relations
    34 # 'is_instance_of' relations
    35 for rtype in ('is', 'is_instance_of'):
    35 for rtype in ('is', 'is_instance_of'):
    36     sql('INSERT INTO %s_relation '
    36     sql('INSERT INTO %s_relation '
    37         'SELECT X.eid, ET.cw_eid FROM entities as X, cw_CWEType as ET '
    37         'SELECT X.eid, ET.cw_eid FROM entities as X, cw_CWEType as ET '
    38         'WHERE X.type=ET.cw_name AND NOT EXISTS('
    38         'WHERE X.type=ET.cw_name AND NOT EXISTS('