[postcreate] properly set is_instance_of for bootstrap entities
authorJulien Cristau <julien.cristau@logilab.fr>
Wed, 21 Oct 2015 17:21:18 +0200
changeset 10803 d261bd7c47cf
parent 10802 3d948d35d94f
child 10804 ee113e1e03de
[postcreate] properly set is_instance_of for bootstrap entities Entities created before CWEType itself need the is/is_instance_of relations created later. We were actually only inserting "is". Closes #7656606.
misc/migration/postcreate.py
--- a/misc/migration/postcreate.py	Wed Oct 28 17:39:30 2015 +0000
+++ b/misc/migration/postcreate.py	Wed Oct 21 17:21:18 2015 +0200
@@ -33,8 +33,8 @@
     sql('INSERT INTO %s_relation '
         'SELECT X.eid, ET.cw_eid FROM entities as X, cw_CWEType as ET '
         'WHERE X.type=ET.cw_name AND NOT EXISTS('
-        '      SELECT 1 from is_relation '
-        '      WHERE eid_from=X.eid AND eid_to=ET.cw_eid)' % rtype)
+        '      SELECT 1 from %s_relation '
+        '      WHERE eid_from=X.eid AND eid_to=ET.cw_eid)' % (rtype, rtype))
 
 # user workflow
 userwf = add_workflow(_('default user workflow'), 'CWUser')