branch | stable |
changeset 2588 | 3a590ff82e99 |
child 8798 | cdab3aadc679 |
2587:79bbc5045288 | 2588:3a590ff82e99 |
---|---|
1 # some entities have been added before schema entities, fix the 'is' and |
|
2 # 'is_instance_of' relations |
|
3 for rtype in ('is', 'is_instance_of'): |
|
4 sql('INSERT INTO %s_relation ' |
|
5 'SELECT X.eid, ET.cw_eid FROM entities as X, cw_CWEType as ET ' |
|
6 'WHERE X.type=ET.cw_name AND NOT EXISTS(' |
|
7 ' SELECT 1 from is_relation ' |
|
8 ' WHERE eid_from=X.eid AND eid_to=ET.cw_eid)' % rtype) |